Logging
The SDK’s built-in logger only emits warnings and errors. You can customize this with two options oncreateTimeback():
SdkLogger
Custom logger instance. Compatible with console, Pino, Winston, Bunyan, and any logger whose
methods accept a string message followed by optional arguments.
SdkLogLevel
default:"warn"
Minimum level for the built-in logger. Ignored when a custom
logger is provided.Custom logger
Pass any logger whose methods accept a string message followed by optional arguments. The SDK prefixes each message with the internal scope, for example[timeback:handlers:user].
Log level
When using the built-in logger,logLevel controls the minimum severity:
Request lifecycle hooks
Track request timing and status with theonRequestStart and onRequestEnd hooks:
activity.record(), and the identity sign-out handler is not wrapped:
|
lessons.list, lessons.start | Lesson discovery and attempt start |
| lessons.next, lessons.submit | Question requests and answers |
| lessons.complete | Lesson completion request |
| lessons.attempts, lessons.attemptDetails | Attempt history |
Logging configuration is global to this SDK module. Creating another server instance replaces the effective logger/settings for existing scoped loggers. The snippets above show logging options; merge them into your complete server configuration.