Global

Methods

# benchmark() → {function}

This decorator wraps the target method to emit Logger.benchmark entries that capture completion time or failure latency.

A method decorator that records execution time at the benchmark level.

sequenceDiagram participant Caller participant Decorator as benchmark participant Method as Original Method Caller->>Decorator: invoke() Decorator->>Method: Reflect.apply(...) alt Promise result Method-->>Decorator: Promise Decorator->>Decorator: attach then() Decorator->>Decorator: log completion duration else Synchronous result Method-->>Decorator: value Decorator->>Decorator: log completion duration end Decorator-->>Caller: return result

View Source decorators.ts, line 79

A method decorator proxy that benchmarks the original implementation.

function

# debug() → {function}

This is a convenience wrapper around log that logs using LogLevel.debug.

A method decorator for logging function calls with the debug level.

View Source decorators.ts, line 138

A debug-level logging decorator.

function

# final() → {function}

This decorator prevents overriding by marking the method descriptor as non-configurable. It will throw an error if it is applied to non-method targets.

Creates a decorator that makes a method non-configurable.

View Source decorators.ts, line 196

A decorator that hardens the method descriptor.

function

# info() → {function}

This is a convenience wrapper around log that logs using LogLevel.info.

A method decorator for logging function calls with the info level.

View Source decorators.ts, line 152

An info-level logging decorator.

function

# log(levelopt, verbosityopt, entryMessageopt, exitMessageopt) → {function}

This decorator wraps a class method to automatically log entry, exit, timing, and optional custom messages at a configurable LogLevel.

A method decorator for logging function calls.

sequenceDiagram participant Client participant Decorator as log decorator participant Method as Original Method participant Logger as Logging instance Client->>Decorator: call decorated method Decorator->>Logger: log method call Decorator->>Method: call original method alt result is Promise Method-->>Decorator: return Promise Decorator->>Decorator: attach then handler Note over Decorator: Promise resolves Decorator->>Logger: log benchmark (if enabled) Decorator-->>Client: return result else result is not Promise Method-->>Decorator: return result Decorator->>Logger: log benchmark (if enabled) Decorator-->>Client: return result end
Parameters:
Name Type Attributes Default Description
level LogLevel <optional>
LogLevel.info

The log level to apply to the generated log statements.

verbosity number <optional>
0

The verbosity threshold that is required for the entry log to appear.

entryMessage ArgFormatFunction <optional>

A formatter that is invoked with the original method arguments to describe the invocation.

exitMessage ReturnFormatFunction <optional>

An optional formatter that describes the outcome or failure of the call.

View Source decorators.ts, line 6

A method decorator proxy that injects logging behavior.

function

# silly() → {function}

This is a convenience wrapper around log that logs using LogLevel.silly.

A method decorator for logging function calls with the silly level.

View Source decorators.ts, line 162

A silly-level logging decorator.

function

# trace() → {function}

This is a convenience wrapper around log that logs using LogLevel.trace.

A method decorator for logging function calls with the trace level.

View Source decorators.ts, line 172

A trace-level logging decorator.

function

# verbose(verbosityopt) → {function}

This is a convenience wrapper around log that logs using LogLevel.verbose with a configurable verbosity.

A method decorator for logging function calls with the verbose level.

Parameters:
Name Type Attributes Default Description
verbosity number | boolean <optional>
0

The verbosity level for log filtering or a flag to enable benchmarking.

View Source decorators.ts, line 182

A verbose logging decorator.

function