* 1、环境变量**:新增 `OPENCLAW_LOG_LEVEL`,可取值 `silent|fatal|error|warn|info|debug|trace`。设置后同时覆盖**文件日志**与**控制台**的级别,优先级高于配置文件。 2、启动参数**:在 `openclaw gateway run` 上新增 `--log-level <level>`,对该次进程同时生效于文件与控制台;未传时仍使用环境变量或配置文件。 * fix(logging): make log-level override global and precedence-safe --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
20 lines
604 B
TypeScript
20 lines
604 B
TypeScript
export const loggingState = {
|
|
cachedLogger: null as unknown,
|
|
cachedSettings: null as unknown,
|
|
cachedConsoleSettings: null as unknown,
|
|
overrideSettings: null as unknown,
|
|
invalidEnvLogLevelValue: null as string | null,
|
|
consolePatched: false,
|
|
forceConsoleToStderr: false,
|
|
consoleTimestampPrefix: false,
|
|
consoleSubsystemFilter: null as string[] | null,
|
|
resolvingConsoleSettings: false,
|
|
streamErrorHandlersInstalled: false,
|
|
rawConsole: null as {
|
|
log: typeof console.log;
|
|
info: typeof console.info;
|
|
warn: typeof console.warn;
|
|
error: typeof console.error;
|
|
} | null,
|
|
};
|