1
0
mirror of https://git.stamm.me/OpenServer/NodeLogging.git synced 2024-12-22 19:59:23 +00:00

Adding option to disable default Logging

This commit is contained in:
Fabian Stamm 2018-09-20 19:38:55 +02:00
parent 3f035ad1b9
commit abba0119c9
4 changed files with 11 additions and 4 deletions

2
out/index.d.ts vendored
View File

@ -69,7 +69,7 @@ export declare class LoggingBase {
private writeToErrorFile(data);
private initializeFile(file, new_file?);
}
export declare const Logging: LoggingBase;
export declare let Logging: any;
export default Logging;
export declare enum LoggingTypes {
Log = 0,

View File

@ -250,7 +250,10 @@ class LoggingBase {
}
}
exports.LoggingBase = LoggingBase;
exports.Logging = new LoggingBase();
exports.Logging = undefined;
if (process.env.LOGGING_NO_DEFAULT !== "true") {
exports.Logging = new LoggingBase();
}
exports.default = exports.Logging;
function fsUnlink(path) {
return new Promise((resolve, reject) => {

File diff suppressed because one or more lines are too long

View File

@ -283,7 +283,11 @@ export class LoggingBase {
return { size: 0, stream: undefined };
}
}
export const Logging = new LoggingBase();
export let Logging = undefined;
if (process.env.LOGGING_NO_DEFAULT !== "true") {
Logging = new LoggingBase();
}
export default Logging;
function fsUnlink(path) {