import * as Transport from "winston-transport"; import { Configuration } from "../configuration"; /** * Global logger instance * By default all logging to this logger will be suppressed. * Call configureLogging to set up console and file transports. */ export declare const logger: Logger; /** * Constants for the logging format */ export declare enum LoggingFormat { /** * Print only the message provided to the logger methods */ None = 0, /** * Print level and message */ Simple = 1, /** * Print the full client related metadata */ Full = 2 } /** * Configuration for the logging sub-system to be passed to configureLogging */ export interface LoggingConfiguration { console: { /** * Enable logging to console */ enabled: boolean; /** * Set log level for the console */ level?: string; /** * Set format of console log */ format?: LoggingFormat; /** * Redirect console.log methods to logger sub-system */ redirect?: boolean; }; file: { /** * Enable file logging */ enabled: boolean; /** * Set log level for file logging */ level?: string; /** * Set file name and path to log into */ filename?: string; /** * Set format for file logging */ format?: LoggingFormat; }; custom?: Transport[]; } /** * Logging configuration suppress all logger logging */ export declare const NoLogging: LoggingConfiguration; /** * Logging configuration to simply pass through log message to the console */ export declare const PlainLogging: LoggingConfiguration; /** * CLI-style logging configuration */ export declare const MinimalLogging: LoggingConfiguration; /** * Default logging configuration for running automation clients */ export declare const ClientLogging: LoggingConfiguration; /** * Configure the logging sub-system with the provided LoggingConfiguration * It is safe to call this method several times to re-configure the logger. * @param config */ export declare function configureLogging(config: LoggingConfiguration): void; /** * Configure the logging sub-system based on the provided Configuration object * @param configuration */ export declare function clientLoggingConfiguration(configuration: Configuration): LoggingConfiguration; export interface Logger { log: LogMethod; error: LeveledLogMethod; warn: LeveledLogMethod; info: LeveledLogMethod; debug: LeveledLogMethod; verbose: LeveledLogMethod; } export interface LogMethod { (level: string, msg: string, callback: LogCallback): Logger; (level: string, msg: string, meta: any, callback: LogCallback): Logger; (level: string, msg: string, ...meta: any[]): Logger; } export interface LeveledLogMethod { (msg: string, callback: LogCallback): Logger; (msg: string, meta: any, callback: LogCallback): Logger; (msg: string, ...meta: any[]): Logger; } export declare type LogCallback = (error?: any, level?: string, msg?: string, meta?: any) => void;