import { ISettingsParam, Logger } from 'tslog'; /** * NOTE: these properties need to be explicitly exported for downstream consumers. * Since they come from a 3rd party library, we can safely ignore them from code coverage. */ export { Logger, ISettingsParam, ILogObject, } from 'tslog'; /** * The valid log levels * @remarks These log levels conform to standard log level definitions * @public */ export declare enum LogLevel { SILLY = "silly", TRACE = "trace", DEBUG = "debug", INFO = "info", WARN = "warn", ERROR = "error", FATAL = "fatal" } /** * The valid output locations for logs * @remarks Additional output locations will be enabled in the future * @public */ export declare enum TransportType { CONSOLE = "console", FILE = "file", NONE = "none", API = "api" } /** * Defines a specific output type, which is log level + location * @public */ export interface Transports { type: TransportType; logLevel: LogLevel; } /** * Render method for log messages * @public */ export declare enum DisplayType { json = "json", pretty = "pretty" } /** * Configuration options for instantiating the Log * @public */ export interface LogOptions { /** * The service name to use for log metadata and file names */ serviceName: string; /** * The minimum log level to capture */ logLevel: LogLevel; /** * An optional collection of all required output targets */ transports?: Transports[]; /** * An optional type for rendering. Choices are `pretty` and `json`. Default is `json`. */ type?: DisplayType; } /** * The default configuration if none is provided. * @defaultValue {@link LogLevel.ERROR} and {@link TransportType.FILE} * @public */ export declare const DefaultLogOptions: ISettingsParam; /** * Constructs a tslog LoggerOptions object based on the provided options * @public * @param options - log options * @returns ISettingsParam */ export declare const buildLoggerConfig: (options?: LogOptions | undefined) => ISettingsParam; /** * Type signature for log method * @public */ export declare type logMethod = (level: LogLevel, message: string, ...args: any[]) => void; /** * Type signature for info method * @public */ export declare type infoMethod = (message: string, ...args: any[]) => void; /** * Type signature for error method * @public */ export declare type errorMethod = (message: string, error: Error, ...args: any[]) => void; /** * Definition of logging implementation requirements * @public */ export interface LogInterface { /** * Allows logging at any desired log level * @param level - the log level to use (DEBUG, INFO, WARN, ERROR) * @param message - a brief description of the issue * @param args - any number of additional string messages, which will be joined together or a JSON object * @returns void */ log: logMethod; /** * Generates an INFO log * @param message - a brief description of the issue * @param args - any number of additional string messages, which will be joined together or a JSON object * @returns void */ debug: infoMethod; /** * Generates an INFO log * @param message - a brief description of the issue * @param args - any number of additional string messages, which will be joined together or a JSON object * @returns void */ info: infoMethod; /** * Generates an WARN log * @param message - a brief description of the issue * @param args - any number of additional string messages, which will be joined together or a JSON object * @returns void */ warn: infoMethod; /** * Generates an ERROR log * @param message - a brief description of the issue * @param args - any number of additional string messages, which will be joined together or a JSON object * @returns void */ error: errorMethod; /** * Generates an FATAL log * @param message - a brief description of the issue * @param args - any number of additional string messages, which will be joined together or a JSON object * @returns void */ fatal: errorMethod; } /** * {@inheritDoc LogInterface} * @public */ export declare class Log implements LogInterface { logger: Logger; /** * @param logOptions - optional configuration options for the logger */ constructor(logOptions?: LogOptions); /** * {@inheritDoc LogInterface.log} */ log: (level: LogLevel, message: string, ...args: any[]) => void; /** * {@inheritDoc LogInterface.info} */ debug: (message: string, ...args: any[]) => void; /** * {@inheritDoc LogInterface.info} */ info: (message: string, ...args: any[]) => void; /** * {@inheritDoc LogInterface.info} */ warn: (message: string, ...args: any[]) => void; /** * {@inheritDoc LogInterface.error} */ error: (message: string, error: Error, ...args: any[]) => void; /** * {@inheritDoc LogInterface.error} */ fatal: (message: string, error: Error, ...args: any[]) => void; } /** * Fetches a static instance of a logger. * @remarks The returned logger will always be the same instance, with the same configuration. * @public * @param logOptions - optional configuration options for the logger * @param reset - reset the static instance with a new configuration */ export declare const getLogger: (logOptions?: LogOptions | undefined, reset?: boolean) => LogInterface; /** * Fetches an instance of a logger. * @remarks The returned logger will always be a new instance, with the same configuration. * @public * @param name - Script/project/method running this logger */ export declare const getCliLogger: (name?: string | undefined) => LogInterface; //# sourceMappingURL=logger.d.ts.map