Skip to main content
Home
Works with
This package works with Deno
This package works with Deno
JSR Score70%
Publisheda year ago (1.0.1)

Core logging library use by the Base Framework.

class BaseLogger

Represents a logger that can be used to log messages with different log levels.

Constructors

new
BaseLogger(
namespace: string,
baseTags?: Array<string>,
)

Creates a new instance of the Logger class.

Properties

Methods

debug(
message: string,
tags?: Array<string>,
context?: LogContext,
): void

Logs a debug message with optional tags.

error(
message: string | Error,
tags?: Array<string>,
context?: LogContext,
): void

Logs an error message with optional tags.

fatal(
message: string,
tags?: Array<string>,
context?: LogContext,
): void

Logs a fatal error message with optional tags.

info(
message: string,
tags?: Array<string>,
context?: LogContext,
): void

Logs an informational message with optional tags.

log(
message: string,
messageTags?: Array<string>,
level?: LogLevel,
context?: LogContext,
): Promise<void>

Logs a message with optional tags, level, and context. If the log level is higher than the current log level, the message is dropped. If the log buffer is full, the message is dropped and an error is logged.

warn(
message: string,
tags?: Array<string>,
context?: LogContext,
): void

Logs a warning message with optional tags.

Static Properties

Map of log levels to corresponding console functions.

private
formatter: LogFormatter
private
redactor: LogMessageRedactor
private
serializer: LogMessageSerializer

Static Methods

private
handleInternalError(
error: Error,
context?: LogContext,
): void
init(config?: LoggerConfig): void

Initializes the logger with the provided configuration.

private
outputLogMessage(logMessage: SerializedLogMessage | LogMessage): void

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@basef/logger

Import symbol

import { BaseLogger } from "@basef/logger";
or

Import directly with a jsr specifier

import { BaseLogger } from "jsr:@basef/logger";