emit function
Last updated: 2026-03-01T23:25:47.125Z
Location
Metrics
LOC: 20
Complexity: 4
Params: 4
Signature
emit(
level: LogLevel | "group",
prefix: string,
args: unknown[],
): : void
Source Code
function emit(
level: LogLevel | "group",
prefix: string,
args: unknown[],
): void {
if (initializing) {
buffer.push({ level, prefix, args });
return;
}
const lvl: LogLevel = level === "group" ? "debug" : level;
if (!shouldLog(lvl)) return;
const logEntry: LogEntry = {
ts: new Date().toISOString(),
level: lvl,
ns: prefix,
msg: formatArgs(args),
};
addLogEntry(logEntry);
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| shouldLog | calls |
| formatArgs | calls |
| addLogEntry | calls |