@empirica/core
Version:
Empirica Core
26 lines (24 loc) • 929 B
TypeScript
declare type LogLine = {
level: string;
args: any[];
};
declare class LogsMock {
logs: LogLine[];
log(line: LogLine): void;
clear(): void;
}
declare function captureLogs(cb: () => void): LogLine[];
declare function captureLogsAsync(cb: () => Promise<void>): Promise<LogLine[]>;
declare function mockLogging(): LogsMock;
declare function stopMockLogging(): void;
declare const levels: {
[key: string]: number;
};
declare function setLogLevel(level: keyof typeof levels): void;
declare const trace: (...args: any[]) => void;
declare const debug: (...args: any[]) => void;
declare const log: (...args: any[]) => void;
declare const info: (...args: any[]) => void;
declare const warn: (...args: any[]) => void;
declare const error: (...args: any[]) => void;
export { LogLine, LogsMock, captureLogs, captureLogsAsync, debug, error, info, levels, log, mockLogging, setLogLevel, stopMockLogging, trace, warn };