UNPKG

plogger-sdk

Version:

Typescript based frontend logging library compatible with multiple transports and JS/TS frameworks

30 lines (29 loc) 905 B
import { logLevelType } from "./logLevel"; import { logRecord } from "./logs/log-record"; export declare abstract class BaseLogger { protected level: logLevelType | null; protected formatter: string | null; /** * defines the enum keys for standardized messaging. */ logEnums: unknown; abstract log(logRecord: logRecord): void; constructor(); /** * sets the threshold level on which any log called with a higher rank / lower priority will be ignored. * @param log_level logLevel */ setLevel(log_level: logLevelType): void; getLevel(): logLevelType; /** * sets a formatter to the log message for the browser * @param formatter string */ setFormatter(formatter: string): void; /** * Generates the formatted log message. * @param log - logRecord * @returns */ formatLog(log: logRecord): string; }