Skip to main content

LoggerInterface

Upgather SDK


Upgather SDK / LoggerInterface

Interface: LoggerInterface

Standard logging interface that allows dependency injection of custom loggers. Implementations can range from simple console loggers to sophisticated logging libraries like Winston or Pino.

Example​

import { LoggerInterface } from '@upgather/sdk';

class MyLogger implements LoggerInterface {
debug(message: string, ...meta: any[]) {
console.debug(`[DEBUG] ${message}`, ...meta);
}
info(message: string, ...meta: any[]) {
console.info(`[INFO] ${message}`, ...meta);
}
warn(message: string, ...meta: any[]) {
console.warn(`[WARN] ${message}`, ...meta);
}
error(message: string, ...meta: any[]) {
console.error(`[ERROR] ${message}`, ...meta);
}
}

Methods​

debug()​

debug(message, ...meta): void

Log debug-level messages for detailed troubleshooting information.

Parameters​

message​

string

The log message

meta​

...unknown[]

Additional metadata to include with the log entry

Returns​

void


error()​

error(message, ...meta): void

Log error messages for error events that might still allow the application to continue.

Parameters​

message​

string

The log message

meta​

...unknown[]

Additional metadata to include with the log entry

Returns​

void


info()​

info(message, ...meta): void

Log informational messages about normal application operations.

Parameters​

message​

string

The log message

meta​

...unknown[]

Additional metadata to include with the log entry

Returns​

void


warn()​

warn(message, ...meta): void

Log warning messages for potentially harmful situations.

Parameters​

message​

string

The log message

meta​

...unknown[]

Additional metadata to include with the log entry

Returns​

void