MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / MessageWriter

Class MessageWriter

src/app/logger/message_writer.ts:5–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4// 通过通讯机制写入日志
5export default class MessageWriter implements Writer {
6 constructor(
7 private msgSender: MessageSend,
8 private action: string = "logger"
9 ) {}
10
11 write(level: LogLevel, message: string, label: LogLabel): void {
12 this.msgSender.sendMessage({
13 action: this.action,
14 data: {
15 id: 0,
16 level,
17 message,
18 label,
19 createtime: Date.now(),
20 },
21 });
22 }
23}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected