@apollo/utils.logger
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

Logger interface

interface Logger {
  debug(message?: any): void;
  info(message?: any): void;
  warn(message?: any): void;
  error(message?: any): void;
}

This generic interface for loggers supports logging a string at one of four different levels (debug, info, warn, error). It's designed to be compatible with Node's console as well as commonly used logging packages and is tested against a few of them. Below are the logging libraries we test for compatibility against.

bunyan

const logger = bunyan.createLogger();

log4js

const logger = log4js.getLogger();

loglevel

const logger = loglevel.getLogger();

winston

const logger = winston.createLogger();

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.0
    112,835
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.0
    112,835
  • 2.0.1
    953,812
  • 2.0.0
    83,655
  • 1.0.1
    886,399
  • 1.0.0
    167,455

Package Sidebar

Install

npm i @apollo/utils.logger

Weekly Downloads

2,204,156

Version

3.0.0

License

MIT

Unpacked Size

7.64 kB

Total Files

10

Last publish

Collaborators

  • dkuc
  • glasser
  • trevor.scheer
  • apollo-bot