MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / emit

Method emit

packages/agent-core/src/logging/logger.ts:120–139  ·  view source on GitHub ↗
(entry: LogEntry)

Source from the content-addressed store, hash-verified

118 }
119
120 emit(entry: LogEntry): void {
121 const config = this.config;
122 if (config === undefined || config.level === 'off') return;
123 if (!levelEnabled(config.level, entry.level)) return;
124
125 const session = this.resolveSessionEntry(entry);
126 if (session !== undefined) {
127 const omitContextKeys = llmRequestSessionLogOmittedKeys(entry);
128 const sessionFormatted = formatEntry(entry, {
129 omitContextKeys,
130 });
131 if (!sessionFormatted.dropped) {
132 session.sink.enqueue(sessionFormatted.text + '\n');
133 }
134 } else {
135 const formatted = formatEntry(entry);
136 if (formatted.dropped) return;
137 this.globalSink?.enqueue(formatted.text + '\n');
138 }
139 }
140
141 detachSession(logId: string): Promise<void> {
142 const entry = this.sessions.get(logId);

Callers 14

makeAgentFunction · 0.45
makeAgentFunction · 0.45
makeAgentFunction · 0.45
processWithStreamErrorFunction · 0.45
createFakeChildFunction · 0.45
events.e2e.test.tsFile · 0.45
recordWireMethod · 0.45
recordRpcMethod · 0.45
emitAtMethod · 0.45
shutdown.test.tsFile · 0.45

Calls 5

resolveSessionEntryMethod · 0.95
levelEnabledFunction · 0.90
formatEntryFunction · 0.90
enqueueMethod · 0.65

Tested by 5

makeAgentFunction · 0.36
makeAgentFunction · 0.36
makeAgentFunction · 0.36
processWithStreamErrorFunction · 0.36
createFakeChildFunction · 0.36