Skip to main content

logWithContext

FitFileViewer - API Documentation v29.9.0


FitFileViewer - API Documentation / main/logging/logWithContext / logWithContext

Function: logWithContext()

logWithContext(level: string, message: string, context?: Record<string, unknown>): void

Defined in: main/logging/logWithContext.js:11

Logs a message from the main process with optional structured context for easier debugging. The implementation mirrors the behaviour that previously lived in main.js so existing log expectations in tests remain unchanged.

Parameters​

level​

string

Console method to invoke.

message​

string

Message to log.

context?​

Record<string, unknown> = {}

Optional context payload serialized to JSON. Default is {}

Returns​

void