createLogger
Factory function to create a new Logger instance.
function createLogger(context, config): Logger;
Defined in: src/utils/logger.ts:318
Factory function to create a new Logger instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | string | A label identifying the source of log messages. |
config | LoggingConfig | Logging configuration controlling enabled state, level, and custom logger. |
Returns
A new Logger instance.
Remarks
This is a convenience wrapper around the Logger constructor. Useful when you prefer a functional style or need to create loggers dynamically.
Example
import { createLogger } from 'composite-voice';
const logger = createLogger('MyApp', { enabled: true, level: 'info' });
logger.info('Application started');