UNPKG

1.53 kBTypeScriptView Raw
1export declare function withCorkedLogging<A>(block: () => Promise<A>): Promise<A>;
2export declare enum LogLevel {
3 /** Not verbose at all */
4 DEFAULT = 0,
5 /** Pretty verbose */
6 DEBUG = 1,
7 /** Extremely verbose */
8 TRACE = 2
9}
10export declare let logLevel: LogLevel;
11export declare let CI: boolean;
12export declare function setLogLevel(newLogLevel: LogLevel): void;
13export declare function setCI(newCI: boolean): void;
14export declare function increaseVerbosity(): void;
15export declare const trace: (fmt: string, ...args: unknown[]) => false | void;
16export declare const debug: (fmt: string, ...args: unknown[]) => false | void;
17export declare const error: (fmt: string, ...args: unknown[]) => void;
18export declare const warning: (fmt: string, ...args: unknown[]) => void;
19export declare const success: (fmt: string, ...args: unknown[]) => void;
20export declare const highlight: (fmt: string, ...args: unknown[]) => void;
21export declare const print: (fmt: string, ...args: unknown[]) => void;
22export declare const data: (fmt: string, ...args: unknown[]) => void;
23export type LoggerFunction = (fmt: string, ...args: unknown[]) => void;
24/**
25 * Create a logger output that features a constant prefix string.
26 *
27 * @param prefixString the prefix string to be appended before any log entry.
28 * @param fn the logger function to be used (typically one of the other functions in this module)
29 *
30 * @returns a new LoggerFunction.
31 */
32export declare function prefix(prefixString: string, fn: LoggerFunction): LoggerFunction;