Lightweight, context-scoped logger.
Each Logger instance is bound to a context string (typically the class or feature name) and a pluggable ILoggingStrategy. The context is automatically prepended to every message so that log output is easy to filter.
Logger
const log = new Logger(new ConsoleLoggingStrategy(), "MyService");log.info("initialised"); // → "[2026-03-23T12:00:00.000Z] MyService: initialised"log.warn("deprecation", [api]); // → "[2026-03-23T12:00:00.000Z] MyService: deprecation" [api] Copy
const log = new Logger(new ConsoleLoggingStrategy(), "MyService");log.info("initialised"); // → "[2026-03-23T12:00:00.000Z] MyService: initialised"log.warn("deprecation", [api]); // → "[2026-03-23T12:00:00.000Z] MyService: deprecation" [api]
Log a debug-level message.
Log an error.
Log an informational message.
Log a warning.
Lightweight, context-scoped logger.
Each
Loggerinstance is bound to a context string (typically the class or feature name) and a pluggable ILoggingStrategy. The context is automatically prepended to every message so that log output is easy to filter.Example