mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 17:10:23 +00:00
fix: stabilize logging config imports
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||
import { parseBooleanValue } from "../utils/boolean.js";
|
||||
|
||||
const log = createSubsystemLogger("env");
|
||||
let log: ReturnType<typeof createSubsystemLogger> | null = null;
|
||||
const loggedEnv = new Set<string>();
|
||||
|
||||
function getLog(): ReturnType<typeof createSubsystemLogger> {
|
||||
if (!log) {
|
||||
log = createSubsystemLogger("env");
|
||||
}
|
||||
return log;
|
||||
}
|
||||
|
||||
type AcceptedEnvOption = {
|
||||
key: string;
|
||||
description: string;
|
||||
@@ -34,7 +41,9 @@ export function logAcceptedEnvOption(option: AcceptedEnvOption): void {
|
||||
return;
|
||||
}
|
||||
loggedEnv.add(option.key);
|
||||
log.info(`env: ${option.key}=${formatEnvValue(rawValue, option.redact)} (${option.description})`);
|
||||
getLog().info(
|
||||
`env: ${option.key}=${formatEnvValue(rawValue, option.redact)} (${option.description})`,
|
||||
);
|
||||
}
|
||||
|
||||
export function normalizeZaiEnv(): void {
|
||||
|
||||
Reference in New Issue
Block a user