UNPKG

@runejs/core

Version:

Core logging, networking, and buffer functionality for RuneJS applications.

44 lines (43 loc) 1.52 kB
import { Logger, LoggerOptions, TimeFn } from 'pino'; export declare const LOGGER_DEFAULT_TIME_FN: true | TimeFn; /** * The main RuneJS wrapper class for the Pino logger. */ export declare class RuneLogger { /** * The logger's active date/time format function for log messages. * IE timestamp: () => `,"time":"${new Date(Date.now()).toISOString()}"` */ loggerTimeFn: true | TimeFn; /** * The main pino logger instance for the wrapper object. */ pinoLogger: Logger; info(...messages: any[]): void; debug(...messages: any[]): void; warn(...messages: any[]): void; error(...messages: any[]): void; trace(...messages: any[]): void; fatal(...messages: any[]): void; private log; } /** * The main logger singleton instance. */ export declare const logger: RuneLogger; /** * Sets the logger options to the given options object. * @param options */ export declare const setLoggerOptions: (options: LoggerOptions) => void; /** * Sets the logger prettyPrint value. * @param prettyPrint The value to set prettyPrint to. */ export declare const setLoggerPrettyPrint: (prettyPrint: boolean) => void; /** * Sets the logger's date/time function to the given value. * @param format The function that will return the partial JSON value of the current time for Pino to ingest. * IE timestamp: () => `,"time":"${new Date(Date.now()).toISOString()}"` */ export declare const setLoggerTimeFn: (format: TimeFn) => void;