Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/logger/src/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class Logger extends Utility implements ClassThatLogs {
logFormatter: this.getLogFormatter(),
};
const parentsPowertoolsLogData = this.getPowertoolLogData();
const childLogger = new Logger(
const childLogger = this.createLogger(
merge(parentsOptions, parentsPowertoolsLogData, options)
);

Expand Down Expand Up @@ -554,6 +554,16 @@ class Logger extends Utility implements ClassThatLogs {
this.processLogItem(16, input, extraInput);
}

/**
* Creates a new Logger instance.
*
* @param {ConstructorOptions} [options]
* @returns {Logger}
*/
protected createLogger(options?: ConstructorOptions): Logger {
return new Logger(options);
}

/**
* Decides whether the current log item should be printed or not.
*
Expand Down