Share via


Logger class

Logger class that provides colored logging functionality using the debug package. Supports different log levels: info, warn, error, and debug.

Constructors

Logger(string)

Creates a new Logger instance with the specified namespace.

Methods

debug(string, any[])

Logs a debug message.

error(string, any[])

Logs an error message.

info(string, any[])

Logs an informational message.

warn(string, any[])

Logs a warning message.

Constructor Details

Logger(string)

Creates a new Logger instance with the specified namespace.

new Logger(namespace?: string)

Parameters

namespace

string

The namespace to use for the logger

Method Details

debug(string, any[])

Logs a debug message.

function debug(message: string, args: any[])

Parameters

message

string

The message to log

args

any[]

Additional arguments to include in the log

error(string, any[])

Logs an error message.

function error(message: string, args: any[])

Parameters

message

string

The message to log

args

any[]

Additional arguments to include in the log

info(string, any[])

Logs an informational message.

function info(message: string, args: any[])

Parameters

message

string

The message to log

args

any[]

Additional arguments to include in the log

warn(string, any[])

Logs a warning message.

function warn(message: string, args: any[])

Parameters

message

string

The message to log

args

any[]

Additional arguments to include in the log