winston-format-debug
Version:
Debug formatter for Winston
41 lines (40 loc) • 1.33 kB
TypeScript
export interface DebugFormatOptions {
levels?: {
[name: string]: number;
};
colors?: {
[name: string]: string | string[];
} | false;
processName?: string;
showPID?: boolean;
basePath?: string;
indent?: number;
maxExceptionLines?: number | 'auto';
colorizePrefix?: boolean;
colorizeMessage?: boolean;
colorizeValues?: boolean;
terminalWidth?: number;
skip?: string[] | ((key: string, value: unknown) => boolean);
}
/**
* Debug formatter intended for logging to console. This is roughly a port
* of bunyan-debug-stream.
*/
export declare class DebugFormat {
options: DebugFormatOptions;
private readonly _processName;
private readonly _maxLevelLength;
private readonly _basepath;
private readonly _colors;
private readonly _indent;
private _skip;
private _skipFn;
constructor(options?: DebugFormatOptions);
private _skipKey;
_getPrefix(info: any, options: DebugFormatOptions): string;
_getValues(info: any, options: DebugFormatOptions): string[];
_formatError(err: Error, options: DebugFormatOptions): string;
transform(info: any, options: DebugFormatOptions): any;
}
export default function createDebugFormat(options?: DebugFormatOptions): DebugFormat;
export declare const Format: typeof DebugFormat;