@zero-version/logging
TypeScript icon, indicating that this package has built-in type declarations

9.9.14 • Public • Published

Logging utilities.

Usage

Using an interface allows for multiple implementations, as well as decorator or adapter implementations if needed. See the LoggerConsole for an example implementation.

ILogger

import type { ILogger } from '@zero-version/logging';

export class Logger implements ILogger {
  public trace(message: string, ...optionalParams: any[]) {
    // Log
  }

  public debug(message: string, ...optionalParams: any[]) {
    // Log
  }

  public info(message: string, ...optionalParams: any[]) {
    // Log
  }

  public warn(message: string, ...optionalParams: any[]) {
    // Log
  }

  public error(message: string, ...optionalParams: any[]) {
    // Log
  }

  public fatal(message: string, ...optionalParams: any[]) {
    // Log
  }
}

Support

Are you using a package I've developed and finding it useful? Or have you looked at one of my repositories and learnt something new? If so, please consider buying me a coffee. Thanks!

Readme

Keywords

Package Sidebar

Install

npm i @zero-version/logging

Weekly Downloads

1

Version

9.9.14

License

UNLICENSED

Unpacked Size

4.2 kB

Total Files

5

Last publish

Collaborators

  • andrewcrobertson