@dot-build/logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@dotbuild/logger

Tiny logger utility for Node.JS and web apps

Usage

import { Logger, LogLevel } from '@dot-build/logger'
const logger = new Logger('any-name');

logger.info('Unicorns are real');

// output to `console.log`: <any-name> Unicorns are real

// Optional. Can be None, Error, Warning, Info, Log, Debug
Logger.setLevel(LogLevel.Info);

Using a different log output

Implement LogOutput interface:

import { Logger, LogOutput } from '@dot-build/logger';

class CustomOutput implements LogOutput {
  log(...args) {
      // do something with arguments
  }
}

Logger.setOutput(new CustomOutput());

Readme

Keywords

none

Package Sidebar

Install

npm i @dot-build/logger

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

16.8 kB

Total Files

10

Last publish

Collaborators

  • darlanalves