traceperf
Version:
High-performance function execution tracking and monitoring for Node.js
78 lines (77 loc) • 2.05 kB
TypeScript
import { ILoggerConfig, LogLevel, LogMode } from '../types';
/**
* Configuration manager for the logger
* Handles merging user config with defaults and provides utility methods
*/
export declare class ConfigManager {
private _config;
/**
* Create a new ConfigManager instance
*
* @param userConfig - User-provided configuration options
*/
constructor(userConfig?: Partial<ILoggerConfig>);
/**
* Get the current configuration
*
* @returns The current configuration
*/
getConfig(): ILoggerConfig;
/**
* Update the configuration
*
* @param newConfig - New configuration options to merge
*/
updateConfig(newConfig: Partial<ILoggerConfig>): void;
/**
* Get the current mode
*
* @returns The current mode
*/
getMode(): LogMode;
/**
* Set the current mode
*
* @param mode - The mode to set
*/
setMode(mode: LogMode): void;
/**
* Check if a log level should be displayed based on the current mode and level
*
* @param level - The log level to check
* @returns Whether the log level should be displayed
*/
shouldLog(level: LogLevel): boolean;
/**
* Get the higher priority level between two log levels
*
* @param levelA - First log level
* @param levelB - Second log level
* @returns The higher priority level
*/
private getHigherPriorityLevel;
/**
* Get the performance threshold
*
* @returns The performance threshold in milliseconds
*/
getPerformanceThreshold(): number;
/**
* Get the indentation size
*
* @returns The number of spaces for each indentation level
*/
getIndentSize(): number;
/**
* Check if colorization is enabled
*
* @returns Whether colorization is enabled
*/
isColorEnabled(): boolean;
/**
* Check if timestamps are enabled
*
* @returns Whether timestamps are enabled
*/
isTimestampEnabled(): boolean;
}