Skip to content

Commit 1dee762

Browse files
committed
fix(node): wrapDebug with options
1 parent 572d1fb commit 1dee762

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/node.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class Log extends LogBase {
9292
options.serializers,
9393
opts ? opts.serializers : {}
9494
)
95-
const _opts = Object.assign({}, options, opts, { serializers })
95+
const _opts = { ...options, ...opts, serializers }
9696
super(name, _opts)
9797

9898
const colorFn = (n) => chalk.hex(n)
@@ -195,10 +195,11 @@ export class Log extends LogBase {
195195
}
196196

197197
/**
198-
* @returns {() => void} unwrap functions
198+
* @param {LogOptions} [opts] - see Log.options
199+
* @returns {() => void} unwrap function
199200
*/
200-
static wrapDebug() {
201-
return wrapDebug(Log)
201+
static wrapDebug(opts) {
202+
return wrapDebug(Log, opts)
202203
}
203204

204205
/**

types/node.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ export class Log extends LogBase {
3535
*/
3636
static handleExitEvents(name?: string, opts?: LogOptionHandleExitEvents): void;
3737
/**
38-
* @returns {() => void} unwrap functions
38+
* @param {LogOptions} [opts] - see Log.options
39+
* @returns {() => void} unwrap function
3940
*/
40-
static wrapDebug(): () => void;
41+
static wrapDebug(opts?: LogOptions): () => void;
4142
/**
4243
* creates a new logger
4344
* @param {String} name - namespace of Logger

0 commit comments

Comments
 (0)