Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/unilogger/src/logger.ts>Logger

Logger utility module for Deno
Latest
class Logger
Abstract
import { Logger } from "https://deno.land/x/unilogger@v1.1.0/src/logger.ts";

This Logger is the base logger class for all logger classes.

Constructors

new
Logger(configs?: LoggerConfigs)

Construct an object of this class.

Properties

protected
configs: LoggerConfigs

Config used for Logging

protected
current_log_message_level_name: string

The level of the log message currently being written. This is used to determine if the message can be logged based on its rank.

protected
log_ranks: { [key: string]: number; }

Methods

protected
constructFullLogMessage(
message: string,
logType: LogTypes,
params: unknown[],
): string

Constructs the end message that will be used to log out, using the message and log type

protected
fillParams(message: string, params: unknown[]): string

Fill the parameters in the message.

protected
getTagStringParsed(): string

Get the parsed version of the raw tag string.

protected
shouldLog(logType: LogTypes): boolean

Should the message be logged based on its rank?

abstract
debug(message: string | unknown, ...params: unknown[]): string | void

Write a message to the console. Prefixed with the log type

abstract
error(message: string): string | void

Write a message to the console. Prefixed with the log type

abstract
fatal(message: string): string | void

Write a message to the console. Prefixed with the log type

abstract
info(message: string): string | void

Write a message to the console. Prefixed with the log type

abstract
trace(message: string): string | void

Write a message to the console. Prefixed with the log type

abstract
warn(message: string): string | void

Write a message to the console. Prefixed with the log type