interface ILogger
Since 0.1.0

Structured logger. All framework and application logging goes through this interface — never console (AI_GUIDELINES §11.6).

Examples

Example 1

const logger = ctx.services.get<ILogger>(CAPABILITIES.LOGGER);
logger.info('User created', { userId: user.id });

const requestLogger = logger.child({ requestId: ctx.id });

Properties

readonly
level: LogLevel

The minimum level this logger emits.

Methods

fatal(
message: string,
metadata?: LogMetadata
): void

Logs at fatal severity.

error(
message: string,
metadata?: LogMetadata
): void

Logs at error severity.

warn(
message: string,
metadata?: LogMetadata
): void

Logs at warn severity.

info(
message: string,
metadata?: LogMetadata
): void

Logs at info severity.

debug(
message: string,
metadata?: LogMetadata
): void

Logs at debug severity.

trace(
message: string,
metadata?: LogMetadata
): void

Logs at trace severity.

Creates a child logger whose entries always include the bindings.

Usage

import { type ILogger } from "common/src/index.ts";