Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

Const customConsoleFormat

customConsoleFormat: Format = printf(info => {const levelPadding = !HAS_COLOR ? 8 : 18;if (LOG_TYPE === "long") {return `${info.level.padEnd(levelPadding)} ${info.timestamp}${info.message}`;} else if (LOG_TYPE === "short") {return `[${info.level.padEnd(levelPadding)}] ${info.message}`;}return `${info.message}`;})

custom logger output in console

Const customFileFormat

customFileFormat: Format = printf(info => {return JSON.stringify({ level: info.level, message: info.message, timestamp: info.timestamp },(_, value: string) => {if (typeof value === "string") {return value.replace(/\u001b\[.*?m/g, "") // color.replace(/\u001b\]8;;/g, "") // link.replace(/\u0007/g, " "); // link}return value;}," ",);})

custom logger output in file

Const show

show: LogMethod = log

Const time

time: Format = timestamp({ format: "DD-MM-YYYY::HH.mm.ss" })

custom timestamp format to DD-MM-YYYY::HH.mm.ss

Functions

Const createConsole

  • createConsole(option: LogOption, formats: Format[]): ConsoleTransportInstance

Const createFile

  • createFile(option: LogOption, formats: Format[]): DailyRotateFileTransportInstance

Const setting

  • setting(option?: LogOption): undefined | object
  • Parameters

    • Default value option: LogOption = {level: LOGGER_LEVEL,color: HAS_COLOR,quiet: IS_QUIET,log: { has: HAS_LOG_FILE, folder: LOG_FOLDER_PATH },}

    Returns undefined | object

Generated using TypeDoc