UNPKG

@mdf.js/logger

Version:

MMS - API Logger - Enhanced logger library for mms artifacts

85 lines 3.88 kB
/** * Copyright 2024 Mytra Control S.L. All rights reserved. * * Use of this source code is governed by an MIT-style license that can be found in the LICENSE file * or at https://opensource.org/licenses/MIT. */ import { Boom, Crash, Multi } from '@mdf.js/crash'; import { LoggerFunction, LoggerInstance } from '../types'; export declare class DebugLogger implements LoggerInstance { private readonly name; /** Debug logger*/ private readonly logger; /** * Creates a new instance of the default logger * @param name - Name of the provider */ constructor(name: string); /** * Log events in the SILLY level: all the information in a very detailed way. * This level used to be necessary only in the development process, and the meta data used to be * the results of the operations. * @param message - human readable information to log * @param uuid - unique identifier for the actual job/task/request process * @param context - context (class/function) where this logger is logging * @param meta - extra information */ silly: LoggerFunction; /** * Log events in the DEBUG level: all the information in a detailed way. * This level used to be necessary only in the debugging process, so not all the data is * reported, only the related with the main processes and tasks. * @param message - human readable information to log * @param uuid - unique identifier for the actual job/task/request process * @param context - context (class/function) where this logger is logging * @param meta - extra information */ debug: LoggerFunction; /** * Log events in the VERBOSE level: trace information without details. * This level used to be necessary only in system configuration process, so information about * the settings and startup process used to be reported. * @param message - human readable information to log * @param uuid - unique identifier for the actual job/task/request process * @param context - context (class/function) where this logger is logging * @param meta - extra information */ verbose: LoggerFunction; /** * Log events in the INFO level: only relevant events are reported. * This level is the default level. * @param message - human readable information to log * @param uuid - unique identifier for the actual job/task/request process * @param context - context (class/function) where this logger is logging * @param meta - extra information */ info: LoggerFunction; /** * Log events in the WARN level: information about possible problems or dangerous situations. * @param message - human readable information to log * @param uuid - unique identifier for the actual job/task/request process * @param context - context (class/function) where this logger is logging * @param meta - extra information */ warn: LoggerFunction; /** * Log events in the ERROR level: all the errors and problems with detailed information. * @param message - human readable information to log * @param uuid - unique identifier for the actual job/task/request process * @param context - context (class/function) where this logger is logging * @param meta - extra information */ error: LoggerFunction; /** * Log events in the ERROR level: all the information in a very detailed way. * This level used to be necessary only in the development process. * @param rawError - crash error instance * @param context - context (class/function) where this logger is logging */ crash: (rawError: Crash | Boom | Multi, context?: string) => void; /** Stream logger */ stream: { write: (message: string) => void; }; } //# sourceMappingURL=DebugLogger.d.ts.map