UNPKG

ng2-logger

Version:

isomorphic logger for browser/server in typescript

82 lines (81 loc) 2.53 kB
import { Level } from './level'; export declare class Logger { private name; color: string; private developmentMode; private allowed; private isMuted; fixedWidth: number | undefined; private _level; setLevel(l: Level): this; get isProductionMode(): boolean; setProductionMode(productionMode: boolean): this; mute(): this; constructor(name: string, color: string, developmentMode: boolean, allowed: Level[], isMuted: boolean, fixedWidth: number | undefined); onlyWhen(expression: (() => boolean) | boolean): void; private _data; private _error; private _info; private _success; private _taskStarted; private _taskDone; private _warn; /** * @see data */ d: (name: string | any, ...data: any[]) => this; /** * @see error */ er: (name: string | any, ...data: any[]) => this; /** * @see info */ i: (name: string | any, ...data: any[]) => this; /** * @see warn */ w: (name: string | any, ...data: any[]) => this; /** * Logs message and data with the level=data * @param message The message * @param otherParams Additional parameters */ data: (message: string, ...otherParams: any[]) => this; /** * Logs message and data with the level=error * @param message The message * @param otherParams Additional parameters */ error: (message: string, ...otherParams: any[]) => this; /** * Logs message and data with the level=info * @param message The message * @param otherParams Additional parameters */ info: (message: string, ...otherParams: any[]) => this; /** * Logs message and data with the level=success * @param message The message * @param otherParams Additional parameters */ success: (message: string, ...otherParams: any[]) => this; /** * Logs message and data with the level=taskStarted * @param message The message * @param otherParams Additional parameters */ taskStarted: (message: string, ...otherParams: any[]) => this; /** * Logs message and data with the level=taskDone * @param message The message * @param otherParams Additional parameters */ taskDone: (message?: string, ...otherParams: any[]) => this; /** * Logs message and data with the level=warn * @param message The message * @param otherParams Additional parameters */ warn: (message: string, ...otherParams: any[]) => this; }