Defines structured log types and levels for cross-language logging adapters.
// Source: https://github.com/MemTensor/MemOS | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
/**
* Wire shape of a single log line. This is the type non-TypeScript adapters
* (e.g. Hermes' Python `log_forwarder.py`) serialize when forwarding their
* own logs back through the bridge so everything ends up in the same files.
*/
export const LOG_LEVELS = ["trace", "debug", "info", "warn", "error", "fatal"] as const;
export type LogLevel = (typeof LOG_LEVELS)[number];
/** Numeric ordering for level comparisons. */
export const LOG_LEVEL_ORDER: Readonly<Record<LogLevel, number>> = Object.freeze({
trace: 10,
debug: 20,
info: 30,
warn: 40,
error: 50,
fatal: 60,
});
/**
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key