1
0
mirror of https://git.hibas.dev/OpenServer/NodeLogging.git synced 2025-07-01 12:41:11 +00:00

Adding automatic logfile creation depending on name

This commit is contained in:
Fabian Stamm
2018-09-01 16:57:21 +02:00
parent 4918fe9b17
commit e973ab7e59
5 changed files with 35 additions and 6 deletions

View File

@ -41,6 +41,14 @@ class LoggingBase {
this.events = new events_1.EventEmitter();
if (!options)
options = {};
if (options.name) {
if (options.logfile === undefined) {
options.logfile = `./logs/all.${options.name}.log`;
}
if (options.errorfile === undefined) {
options.logfile = `./logs/error.${options.name}.log`;
}
}
this.config = Object.assign({
name: undefined,
console_out: true,

File diff suppressed because one or more lines are too long