@nanocollective/nanocoder
Version:
A local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter
70 lines • 1.92 kB
TypeScript
/**
* Output formatters for JSON and pretty logging
*/
import type { LogEntry } from './types.js';
/**
* Format log level as uppercase string
*/
export declare function formatLevel(label: string, _number: number): {
level: string;
};
/**
* Custom timestamp formatter
*/
export declare function formatTimestamp(time: number): {
time: string;
};
/**
* Format timestamp for development (human readable)
*/
export declare function formatTimestampDev(time: number): {
time: string;
};
/**
* Sanitize error objects for JSON serialization
*/
export declare function serializeError(err: Error): Record<string, any>;
/**
* Format log entry for production JSON output
*/
export declare function formatProductionLog(log: LogEntry): LogEntry;
/**
* Format log entry for development pretty output
*/
export declare function formatDevelopmentLog(log: LogEntry): LogEntry;
/**
* Create Pino formatters configuration
*/
export declare function createFormatters(isProduction?: boolean): {
level: typeof formatLevel;
log: typeof formatProductionLog;
time: typeof formatTimestampDev;
};
/**
* Message formatter for custom log messages
*/
export declare function formatMessage(template: string, bindings: Record<string, any>, level: string): string;
/**
* Color mapping for different log levels (development only)
*/
export declare const levelColors: Record<string, string>;
/**
* Get color for log level
*/
export declare function getLevelColor(level: string): string;
/**
* Create pretty print formatter for development
*/
export declare function createPrettyFormatter(): {
translateTime: string;
ignore: string;
messageFormat: string;
customPrettifiers: {
time: (timestamp: number) => string;
level: (label: string) => string;
hostname: () => string;
};
colorize: boolean;
levelFirst: boolean;
};
//# sourceMappingURL=formatters.d.ts.map