traceperf
Version:
High-performance function execution tracking and monitoring for Node.js
51 lines (50 loc) • 1.36 kB
TypeScript
import { IFormatter, LogLevel, LogMeta } from '../types';
/**
* CLI formatter for console output
* Formats log entries with colors, icons, and indentation
*/
export declare class CliFormatter implements IFormatter {
private _colorEnabled;
private _indentSize;
/**
* Create a new CliFormatter instance
*
* @param options - Formatter options
*/
constructor(options?: {
colorEnabled?: boolean;
indentSize?: number;
});
/**
* Format a log entry for CLI output
*
* @param level - The log level
* @param message - The log message
* @param args - Additional arguments
* @param meta - Metadata for the log entry
* @returns The formatted log entry
*/
format(level: LogLevel, message: string | object, args: any[], meta: LogMeta): string;
/**
* Format a timestamp
*
* @param date - The date to format
* @returns The formatted timestamp
*/
private formatTimestamp;
/**
* Format a log level
*
* @param level - The log level
* @returns The formatted log level
*/
private formatLevel;
/**
* Format a message and its arguments
*
* @param message - The message to format
* @param args - Additional arguments
* @returns The formatted message
*/
private formatMessage;
}