UNPKG

radius-read

Version:

Realtime Dashboard

131 lines (130 loc) 3.29 kB
import { LogAppender } from './../models/logger.model'; /** * LoggerService provides methods for logging messages with different severity levels. */ export declare class LoggerService { /** * Project root directory path * @date Jun 26, 2025 10:55:41 AM * @author Biswaranjan Nayak * * @private * @type {string} */ private PROJECT_ROOT; /** * Logger instance * @date Jun 26, 2025 10:56:22 AM * @author Biswaranjan Nayak * * @private * @type {!*} */ private LOGGER; /** * Variable to check if custom format is enabled * @date Jun 26, 2025 10:56:32 AM * @author Biswaranjan Nayak * * @private * @type {boolean} */ private iscustomFormatEnabled; /** * Creates an instance of LoggerService. */ constructor(); /** * Initializes the logger with the given log appender and custom format option. * @param logAppender * @param customFormat * @returns */ init(logAppender: LogAppender, customFormat?: boolean): boolean; /** * Configures the logger based on the provided configuration. * @param config * @returns */ private configure; /** * Configures the console logger with the provided options and custom format. * @param logOptions * @param customFormat */ private configureConsoleLogger; /** * Configures the file logger with the provided options and custom format. * @param logOptions * @param customFormat */ private configureFileLogger; /** * Configures the multi logger with console and file options, and custom format. * @param consoleLogOptions * @param fileLogOptions * @param customFormat */ private configureMultiLogger; /** * Debug log method to log debug messages. * @param args */ debug(...args: any[]): void; /** * Log method to log messages at the default level. * @param args */ log(...args: any[]): void; /** * Info log method to log informational messages. * @param args */ info(...args: any[]): void; /** * Warn log method to log warning messages. * @param args */ warn(...args: any[]): void; /** * Error log method to log error messages. * @param args */ error(...args: any[]): void; /** * Fatal log method to log fatal error messages. * @param args * @returns */ private formatLogArguments; /** * Joins an array of arguments into a formatted string. * @param args * @returns */ private joinArray; /** * Gets stack information for the specified stack index. * @param stackindex * @returns */ private getStackInfo; /** * Custom format for log messages with timestamp, level, and message. * @date Jun 26, 2025 10:59:25 AM * @author Biswaranjan Nayak * * @private * @type {*} */ private customFormat; /** * No custom format for log messages, just prints the message to console. * @date Jun 26, 2025 10:59:37 AM * @author Biswaranjan Nayak * * @private * @type {*} */ private nocustomFormat; }