@athenna/logger
Version:
The Athenna logging solution. Log in stdout, files and buckets.
86 lines (85 loc) • 2.04 kB
TypeScript
/**
* @athenna/logger
*
* (c) João Lenon <lenon@athenna.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
export declare abstract class Formatter {
/**
* Holds the configuration object of formatter.
*/
configs: any;
/**
* Creates a new instance of Formatter.
*/
config(configs: any): Formatter;
/**
* Format the message.
*/
abstract format(message: any): string;
/**
* Create the PID for formatter.
*/
pid(): string;
/**
* Create the hostname for formatter.
*/
hostname(): string;
/**
* Get the level without any color or format.
*/
level(): string;
/**
* Get the trace id for formatter.
*/
traceId(): string | null;
/**
* Create the timestamp for formatter.
*/
timestamp(): string;
/**
* Transform the message to string.
*/
toString(message: string): string;
/**
* Clean the message removing colors if clean
* option is true. If force is true, then colors
* will be removed even if configs clean option
* is false.
*/
clean(message: string, force?: boolean): string;
/**
* Apply all colors necessary to message.
*/
applyColors(message: string): string;
/**
* Apply colors in message.
*/
applyColorsByChalk(message: string): string;
/**
* Apply colors in message by level.
*/
applyColorsByLevel(message: string): string;
/**
* Create the cli level string.
*/
cliLevel(): string;
/**
* Create the simple level string.
*/
simpleLevel(): string;
/**
* Create the message level emoji string.
*/
messageLevel(): string;
/**
* Get the emoji by level.
*/
getEmojiByLevel(level: string, customEmoji?: string): string;
/**
* Paint the message by level.
*/
paintMessageByLevel(level: string, message: string): string;
}