Optional options: KosLoggerAwareOptionsConfiguration options for the logger injection
A class decorator
// Basic usage with default logger property
@kosLoggerAware()
class MyModel { }
// Custom logger property name
@kosLoggerAware({ loggerProperty: 'log' })
class MyModel {
// this.log is available instead of this.logger
}
// Custom logger context for specialized logging
@kosLoggerAware({ loggerContext: 'analytics' })
class AnalyticsModel {
// Logger uses "analytics" context instead of model type
}
2.1.0
Class decorator that automatically injects a shared logger into a KOS model.
This decorator eliminates the need for manual logger setup in constructors by:
Performance Note: Creates one logger per model type, shared across all instances of that type. This is much more efficient than per-instance logger creation.
Important: Use TypeScript interface merging to get proper type information: