MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / DebugAdapterLogger

Class DebugAdapterLogger

src/debug/logging.ts:8–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7// A logger that passes log events back to the UI in `dart.log` events.
8export class DebugAdapterLogger implements Logger {
9 constructor(private readonly debugClient: { sendEvent: (event: DebugProtocol.Event) => void }, private readonly category: LogCategory) { }
10
11 private log(message: string, severity: LogSeverity, category = this.category): void {
12 this.debugClient.sendEvent(new Event("dart.log", { message, severity, category } as LogMessage));
13 }
14
15 public info(message: string, category?: LogCategory): void {
16 this.log(message, LogSeverity.Info, category);
17 }
18 public warn(errorOrMessage: any, category?: LogCategory): void {
19 this.log(errorString(errorOrMessage), LogSeverity.Warn, category);
20 }
21 public error(errorOrMessage: any, category?: LogCategory): void {
22 this.log(errorString(errorOrMessage), LogSeverity.Error, category);
23 }
24}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected