nice-logs
Version:
Pretty console logs.
69 lines (68 loc) • 2.18 kB
TypeScript
/**
* Nice log with pretty colors.
*/
export declare class Log {
private static timer;
/**
* Text of the modes like 'INFO', 'WARN', etc.
*/
static modeText: {
info: string;
warn: string;
error: string;
success: string;
};
/**
* CSS styles. e.g. 'color: blue'
*/
static logStyle: {
info: string;
success: string;
warning: string;
danger: string;
time: string;
title: string;
};
/**
* Time stamps option.
*/
static timeStampEnabled: boolean;
/**
* Returns a time in milliseconds.
* Either in high resolution (if supported, nanoseconds) from app start time or milliseconds since 1970.
*/
static getTime(): number;
/**
* Prints a more custom log. This is not the recommended way to log. Use the other methods like .info(...).
* @param modeText Mode text like 'INFO'.
* @param style CSS stlyes like 'color: blue'.
* @param printTime Prints the time stamp.
* @param msgs One or more messages. (same you pass in console.log(...))
*/
static custom(modeText: string, style: string, printTime: boolean, ...msgs: any[]): void;
/**
* Prints text with large font.
* @param title Some text.
*/
static title(title: string): void;
/**
* Prints an info message. Like console.log().
* @param msgs One or more messages. (same you pass in console.log(...))
*/
static info(...msgs: any[]): void;
/**
* Prints a warning message. Like console.warn().
* @param msgs One or more messages. (same you pass in console.log(...))
*/
static warn(...msgs: any[]): void;
/**
* Prints an error message. Like console.error().
* @param msgs One or more messages. (same you pass in console.log(...))
*/
static error(...msgs: any[]): void;
/**
* Prints a successful message. A green message for OK or DONE.
* @param msgs One or more messages. (same you pass in console.log(...))
*/
static success(...msgs: any[]): void;
}