Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/clarigen/src/deps.ts>logger.Logger

Deno package for type-safe Clarinet tests
Go to Latest
class logger.Logger
Re-export
import { logger } from "https://deno.land/x/clarigen@v0.4.3/src/deps.ts";
const { Logger } = logger;

Constructors

new
Logger(
loggerName: string,
levelName: LevelName,
options?: LoggerOptions,
)

Properties

handlers: BaseHandler[]
level: LogLevels
levelName: LevelName
readonly
loggerName: string

Methods

private
_log<T>(
level: number,
msg: (T extends GenericFunction ? never : T) | (() => T),
...args: unknown[],
): T | undefined

If the level of the logger is greater than the level to log, then nothing is logged, otherwise a log record is passed to each log handler. msg data passed in is returned. If a function is passed in, it is only evaluated if the msg will be logged and the return value will be the result of the function, not the function itself, unless the function isn't called, in which case undefined is returned. All types are coerced to strings for logging.

asString(data: unknown): string
critical<T>(msg: () => T, ...args: unknown[]): T | undefined
critical<T>(msg: T extends GenericFunction ? never : T, ...args: unknown[]): T
debug<T>(msg: () => T, ...args: unknown[]): T | undefined
debug<T>(msg: T extends GenericFunction ? never : T, ...args: unknown[]): T
error<T>(msg: () => T, ...args: unknown[]): T | undefined
error<T>(msg: T extends GenericFunction ? never : T, ...args: unknown[]): T
info<T>(msg: () => T, ...args: unknown[]): T | undefined
info<T>(msg: T extends GenericFunction ? never : T, ...args: unknown[]): T
warning<T>(msg: () => T, ...args: unknown[]): T | undefined
warning<T>(msg: T extends GenericFunction ? never : T, ...args: unknown[]): T