ursamu-mud
Version:
Ursamu - Modular MUD Engine with sandboxed scripting and plugin system
94 lines (93 loc) • 2.06 kB
TypeScript
/**
* Logging utility for CLI commands
*/
import { CLIConfig } from '../config/CLIConfig.js';
export declare enum LogLevel {
ERROR = 0,
WARN = 1,
INFO = 2,
DEBUG = 3,
VERBOSE = 4
}
interface LogEntry {
timestamp: Date;
level: LogLevel;
message: string;
data?: any;
}
export declare class Logger {
private config;
private logHistory;
constructor(config: CLIConfig);
/**
* Log error message
*/
error(message: string, data?: any): void;
/**
* Log warning message
*/
warn(message: string, data?: any): void;
/**
* Log info message
*/
info(message: string, data?: any): void;
/**
* Log debug message (only if verbose)
*/
debug(message: string, data?: any): void;
/**
* Log verbose message (only if verbose)
*/
verbose(message: string, data?: any): void;
/**
* Log success message
*/
success(message: string, data?: any): void;
/**
* Log with custom formatting
*/
custom(message: string, color?: string, prefix?: string): void;
/**
* Log raw message without formatting
*/
raw(message: string): void;
/**
* Create a progress logger for long operations
*/
progress(total: number, label?: string): ProgressLogger;
/**
* Get log history
*/
getHistory(maxEntries?: number): LogEntry[];
/**
* Clear log history
*/
clearHistory(): void;
/**
* Export logs to string
*/
exportLogs(): string;
private log;
}
/**
* Progress logger for tracking long operations
*/
export declare class ProgressLogger {
private current;
private total;
private label;
private config;
private startTime;
constructor(total: number, label: string, config: CLIConfig);
/**
* Update progress
*/
update(current: number, message?: string): void;
/**
* Complete progress
*/
complete(message?: string): void;
private createProgressBar;
private formatTime;
}
export {};