mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 12:04:59 +00:00
logging: fix sub-logger inheriting undefined minLevel from parent
This commit is contained in:
@@ -145,9 +145,11 @@ export function getChildLogger(
|
||||
const base = getLogger();
|
||||
const minLevel = opts?.level ? levelToMinLevel(opts.level) : undefined;
|
||||
const name = bindings ? JSON.stringify(bindings) : undefined;
|
||||
// Only pass minLevel when explicitly set; spreading `minLevel: undefined`
|
||||
// overwrites the parent logger's minLevel, disabling tslog's level filter.
|
||||
return base.getSubLogger({
|
||||
name,
|
||||
minLevel,
|
||||
...(minLevel != null ? { minLevel } : {}),
|
||||
prefix: bindings ? [name ?? ""] : [],
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user