@minimaltech/ra-infra
Version:
Minimal Technology ReactJS Infrastructure
35 lines (34 loc) • 987 B
TypeScript
export type TLogLevel = 'debug' | 'info' | 'warn' | 'error';
export interface ILogger {
debug(message: string, ...args: any[]): void;
info(message: string, ...args: any[]): void;
warn(message: string, ...args: any[]): void;
error(message: string, ...args: any[]): void;
}
export declare class Logger implements ILogger {
private static instance;
private isDebugEnabled;
constructor(opts?: {
enableDebug: boolean;
});
static getInstance(opts?: {
enableDebug: boolean;
}): Logger;
getTimestamp(): string;
toggleDebug(opts?: {
state: boolean;
}): void;
generateLog(opts: {
level: TLogLevel;
message: any;
args: any[];
}): {
message: string;
args: any[];
};
private log;
debug(message: any, ...args: any[]): void;
info(message: any, ...args: any[]): void;
warn(message: any, ...args: any[]): void;
error(message: any, ...args: any[]): void;
}