pino-princess
Version:
Prettiest Pino Prettifier in all the land
61 lines • 2.1 kB
TypeScript
import _highlight from 'cli-highlight';
import { type ChalkInstance } from 'chalk';
import type { SerializedError } from 'pino';
import type { NumLevels, Levels, PrettifyOptions } from './utils/types.js';
export declare function formatLevel(_level: NumLevels | Levels): string;
export declare function formatLoadTime(elapsedTime: string | number): string;
export declare function formatTime(instant: string | number, timeFormat?: string): string;
export declare function formatName(name: string): string;
export declare function formatMessage(message: string, { level }: {
level: NumLevels | Levels;
}): string;
export declare function formatBundleSize(bundle: string): string;
export declare function formatUrl(url: string, { res: { statusCode } }?: {
res?: Record<string, unknown>;
}): string;
export declare function formatMethod(method: string): string;
export declare function formatStatusCode(statusCode?: string | number): string;
export declare function formatStack(stack: string): string;
export declare function formatErrorProp(errorPropValue: Partial<SerializedError & {
aggregateErrors?: SerializedError[];
}>): string;
export declare function formatExtraFields(extraFields: Record<string, any>, options?: {
theme?: (chalk: ChalkInstance) => _highlight.Theme;
singleLine?: boolean;
}): string;
export declare function formatId(id: string): string;
export declare function prettify({
/**
* The key to use for the error object. Defaults to `err`.
*/
errorKey,
/**
* The key to use for the message object. Defaults to `msg`.
*/
messageKey,
/**
* Format string for time display using date-fns format
*/
timeFormat,
/**
* Whether to format the output as a single line
*/
singleLine,
/**
* include and exclude both take keys with dot notation
*/
exclude,
/**
* include always overrides exclude
*/
include,
/**
* Theme for the extra fields object
*/
theme,
/**
* Format functions for any given key
*/
format, }?: PrettifyOptions): (inputData: string | Record<string, unknown>) => string;
export default prettify;
//# sourceMappingURL=prettify.d.ts.map