UNPKG

@athenna/logger

Version:

The Athenna logging solution. Log in stdout, files and buckets.

85 lines (84 loc) 2.47 kB
/** * @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. */ import { Macroable } from '@athenna/common'; export declare class Logger extends Macroable { /** * The drivers responsible for transporting the logs. */ private drivers; /** * Runtime configurations to be used inside the Drivers and Formatters. */ private runtimeConfigs; constructor(); /** * Create a new standalone logger instance. Very * useful to create new loggers without changing the * channels that are already defined in the main instance. */ static standalone(...configs: any[]): Logger; /** * Set runtime configurations for drivers and * formatters. */ config(runtimeConfigs: any): Logger; /** * Change the log channel. */ channel(...channels: string[]): Logger; /** * Change the log drivers using vanilla configurations. * This method does not depend in Athenna configuration * files to be executed. */ vanilla(...configs: any[]): Logger; /** * Verify if channel configuration exists. If not, Athenna will * use the default vanilla configurations as drivers. */ channelOrVanilla(channel: string, configs?: {}): Logger; /** * Create a new standalone logger instance. Very * useful to create new loggers without changing the * channels that are already defined in the main instance. */ standalone(...configs: any[]): Logger; /** * Creates a log of type trace in channel. */ trace(...args: any[]): any | Promise<any>; /** * Creates a log of type debug in channel. */ debug(...args: any[]): any | Promise<any>; /** * Creates a log of type info in channel. */ info(...args: any[]): any | Promise<any>; /** * Creates a log of type success in channel. */ success(...args: any[]): any | Promise<any>; /** * Creates a log of type warn in channel. */ warn(...args: any[]): any | Promise<any>; /** * Creates a log of type error in channel. */ error(...args: any[]): any | Promise<any>; /** * Creates a log of type fatal in channel. */ fatal(...args: any[]): any | Promise<any>; /** * Call drivers to transport the log. */ private log; }