Interface for models using

Kos Logger Aware

decorator. Use TypeScript interface merging to add the logger property to your model class.

Example

interface MyModelImpl extends KosLoggerAware {}

@kosModel("my-model")
@kosLoggerAware()
export class MyModelImpl implements IKosDataModel {
id: string;

constructor(modelId: string, options: any, context: KosCreationContext) {
this.id = modelId;
// No logger setup needed - automatically injected!
}

async performOperation() {
this.logger.info("Starting operation"); // Direct access to logger
}
}
interface KosLoggerAware {
    logger: Logger;
}

Properties

Properties

logger: Logger

KOS context logger for this model instance. Automatically injected by the

Kos Logger Aware

decorator. Shared across all instances of the same model type for optimal performance. Provides structured logging with debug(), info(), warn(), and error() methods. Logger context is automatically set to the model type name unless overridden.