Skip to content

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

ParameterTypeDescription
contextstringA label identifying the source of log messages.
configLoggingConfigLogging configuration controlling enabled state, level, and custom logger.

Returns

Logger

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');

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency