import debug from 'debug' ; category export enum LogSeverity { /**
     * Trace level logging, extremely detailed.
     */ Trace , /**
     * Debug level logging, helpful to debug some forms of issues.
     */ Debug , /**
     * Info level logging, this is the default log level and includes
     * general information about what is happening.
     */ Info , /**
     * Warn level logging, these represents issues that should be addressed,
     * but which do not prevent the full functioning of the SDK.
     */ Warn , /**
     * Error level logging, these represent issues that must be addressed,
     * but which do not cause the entire SDK to need to shut down.
     */ Error , /**
     * Fatal level logging, these represent fatal issues that require the
     * SDK to completely stop.
     */ Fatal } category export interface LogData { /**
     * Indicates the severity level for this log message.
     */ severity : LogSeverity ; /**
     * The source file where the log message was generated, if available.
     */ srcFile : string ; /**
     * The source line where the log message was generated, if available.
     */ srcLine : number ; /**
     * The sub-system which generated the log message.
     */ subsys : string ; /**
     * The log message itself.
     */ message : string ; } category export interface LogFunc { ( data ) : void ; } internal const libLogger = debug ( 'couchnode' ) ; export { libLogger } ; const lcbLogger = libLogger . extend ( 'lcb' ) ; const severityLoggers = { [ LogSeverity . Trace ] : lcbLogger . extend ( 'trace' ) , [ LogSeverity . Debug ] : lcbLogger . extend ( 'debug' ) , [ LogSeverity . Info ] : lcbLogger . extend ( 'info' ) , [ LogSeverity . Warn ] : lcbLogger . extend ( 'warn' ) , [ LogSeverity . Error ] : lcbLogger . extend ( 'error' ) , [ LogSeverity . Fatal ] : lcbLogger . extend ( 'fatal' ) , } ; internal function _logSevToLogger ( severity ) { const logger = severityLoggers [ severity ] ; if ( logger ) { return logger ; } return lcbLogger . extend ( 'sev' + severity ) ; } internal function logToDebug ( data ) { const logger = _logSevToLogger ( data . severity ) ; const location = data . srcFile + ':' + data . srcLine ; logger ( '(' + data . subsys + ' @ ' + location + ') ' + data . message ) ; } category export const defaultLogger = logToDebug ;