mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 16:40:22 +00:00
fix(logging): break console/logger type cycle
This commit is contained in:
@@ -5,12 +5,13 @@ import { stripAnsi } from "../terminal/ansi.js";
|
||||
import { readLoggingConfig, shouldSkipMutatingLoggingConfigRead } from "./config.js";
|
||||
import { resolveEnvLogLevelOverride } from "./env-log-level.js";
|
||||
import { type LogLevel, normalizeLogLevel } from "./levels.js";
|
||||
import { getLogger, type LoggerSettings } from "./logger.js";
|
||||
import { getLogger } from "./logger.js";
|
||||
import { resolveNodeRequireFromMeta } from "./node-require.js";
|
||||
import { loggingState } from "./state.js";
|
||||
import { formatLocalIsoWithOffset, formatTimestamp } from "./timestamps.js";
|
||||
import type { ConsoleStyle, LoggerSettings } from "./types.js";
|
||||
|
||||
export type ConsoleStyle = "pretty" | "compact" | "json";
|
||||
export type { ConsoleStyle } from "./types.js";
|
||||
type ConsoleSettings = {
|
||||
level: LogLevel;
|
||||
style: ConsoleStyle;
|
||||
|
||||
@@ -7,12 +7,13 @@ import {
|
||||
resolvePreferredOpenClawTmpDir,
|
||||
} from "../infra/tmp-openclaw-dir.js";
|
||||
import { readLoggingConfig, shouldSkipMutatingLoggingConfigRead } from "./config.js";
|
||||
import type { ConsoleStyle } from "./console.js";
|
||||
import { resolveEnvLogLevelOverride } from "./env-log-level.js";
|
||||
import { type LogLevel, levelToMinLevel, normalizeLogLevel } from "./levels.js";
|
||||
import { resolveNodeRequireFromMeta } from "./node-require.js";
|
||||
import { loggingState } from "./state.js";
|
||||
import { formatTimestamp } from "./timestamps.js";
|
||||
import type { LoggerSettings } from "./types.js";
|
||||
export type { LoggerSettings } from "./types.js";
|
||||
|
||||
type ProcessWithBuiltinModule = NodeJS.Process & {
|
||||
getBuiltinModule?: (id: string) => unknown;
|
||||
@@ -50,14 +51,6 @@ const DEFAULT_MAX_LOG_FILE_BYTES = 500 * 1024 * 1024; // 500 MB
|
||||
|
||||
const requireConfig = resolveNodeRequireFromMeta(import.meta.url);
|
||||
|
||||
export type LoggerSettings = {
|
||||
level?: LogLevel;
|
||||
file?: string;
|
||||
maxFileBytes?: number;
|
||||
consoleLevel?: LogLevel;
|
||||
consoleStyle?: ConsoleStyle;
|
||||
};
|
||||
|
||||
type LogObj = { date?: Date } & Record<string, unknown>;
|
||||
|
||||
type ResolvedSettings = {
|
||||
|
||||
11
src/logging/types.ts
Normal file
11
src/logging/types.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { LogLevel } from "./levels.js";
|
||||
|
||||
export type ConsoleStyle = "pretty" | "compact" | "json";
|
||||
|
||||
export type LoggerSettings = {
|
||||
level?: LogLevel;
|
||||
file?: string;
|
||||
maxFileBytes?: number;
|
||||
consoleLevel?: LogLevel;
|
||||
consoleStyle?: ConsoleStyle;
|
||||
};
|
||||
Reference in New Issue
Block a user