Skip to main content

useLogWithContext

@webda/workout


Function: useLogWithContext()

useLogWithContext(level, context, ...args): void

Defined in: packages/workout/src/core.ts:77

Log a message with additional context information

Parameters​

level​

WorkerLogLevel

The log level (ERROR, WARN, INFO, DEBUG, TRACE)

context​

any

Context object to attach to the log. If context.addLogProducerLine is true, adds file/line/function info

args​

...any[]

Message arguments to log

Returns​

void

Example​

useLogWithContext("INFO", { userId: 123 }, "User logged in");
useLogWithContext("DEBUG", { addLogProducerLine: true }, "Debug info");