mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-24 22:48:06 +00:00
e438887dfb
* build: lazy load initialization modules * build: lazy load and initialize logger * chore: lint fix * Update lib/constants/error-messages.ts Co-authored-by: Jamie Tanna <jamie.tanna@mend.io> * Apply suggestion Co-authored-by: Jamie Tanna <jamie.tanna@mend.io> --------- Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
56 lines
1.3 KiB
TypeScript
56 lines
1.3 KiB
TypeScript
import type { Stream } from 'node:stream';
|
|
import type { LogLevel, LogLevelString } from 'bunyan';
|
|
|
|
export type {
|
|
LogLevelString as BunyanLogLevel,
|
|
Serializers as BunyanSerializers,
|
|
Stream as BunyanStream,
|
|
} from 'bunyan';
|
|
|
|
export interface LogError {
|
|
level: LogLevel;
|
|
meta: any;
|
|
msg?: string;
|
|
}
|
|
|
|
export interface Logger {
|
|
trace(msg: string): void;
|
|
trace(meta: Record<string, any>, msg?: string): void;
|
|
debug(msg: string): void;
|
|
debug(meta: Record<string, any>, msg?: string): void;
|
|
info(msg: string): void;
|
|
info(meta: Record<string, any>, msg?: string): void;
|
|
warn(msg: string): void;
|
|
warn(meta: Record<string, any>, msg?: string): void;
|
|
error(msg: string): void;
|
|
error(meta: Record<string, any>, msg?: string): void;
|
|
fatal(msg: string): void;
|
|
fatal(meta: Record<string, any>, msg?: string): void;
|
|
|
|
once: Logger & {
|
|
reset: () => void;
|
|
};
|
|
}
|
|
|
|
export interface BunyanRecord extends Record<string, any> {
|
|
level: number;
|
|
msg: string;
|
|
module?: string;
|
|
}
|
|
|
|
export type BunyanNodeStream = (NodeJS.WritableStream | Stream) & {
|
|
writable?: boolean;
|
|
write: (
|
|
chunk: BunyanRecord,
|
|
enc: BufferEncoding,
|
|
cb: (err?: Error | null) => void,
|
|
) => void;
|
|
};
|
|
|
|
export type BunyanLogger = ReturnType<typeof import('bunyan').createLogger>;
|
|
|
|
export interface LogLevelRemap {
|
|
matchMessage: string;
|
|
newLogLevel: LogLevelString;
|
|
}
|