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:
@ -59,6 +59,15 @@ export class LoggingBase {
|
||||
|
||||
constructor(options?: Partial<LoggingBaseOptions>) {
|
||||
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(<LoggingBaseOptions>{
|
||||
name: undefined,
|
||||
console_out: true,
|
||||
|
Reference in New Issue
Block a user