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

1.0.0 • Public • Published

@xpring-eng/logger

NPM version badge

A TypeScript logger utilizing Log4JS.

Usage

This logger library was designed to be a zero-config way to use Log4JS using the xpring-eng defaults for logging.

import createLogger from '@xpring-eng/logger'

// The log level you pass to createLogger()
// will be the level of logs that actually get emitted.
const logger = createLogger('INFO')

export default logger

Log Levels

There are multiple valid log levels:

// Log Levels
//
// OFF    Designates no log messages should be shown
// MARK   Designates an event that will almost always be logged. Useful for temporary logging.
// FATAL  Designates very severe error events that will presumably lead the application to abort.
// ERROR  Designates error events that might still allow the application to continue running.
// WARN   Designates potentially harmful situations.
// INFO   Designates informational messages that highlight the progress of the application at coarse-grained level.
// DEBUG  Designates fine-grained informational events that are most useful to debug an application.
// TRACE  Designates finer-grained informational events than the DEBUG.
// ALL    Designates all log events should be shown (equivalent to TRACE)

enum LogLevel {
  OFF = 'OFF',
  MARK = 'MARK',
  FATAL = 'FATAL',
  ERROR = 'ERROR',
  WARN = 'WARN',
  INFO = 'INFO',
  DEBUG = 'DEBUG',
  TRACE = 'TRACE',
  ALL = 'ALL',
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.00latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.00

Package Sidebar

Install

npm i @xpring-eng/logger

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

13.4 kB

Total Files

16

Last publish

Collaborators

  • petewebb
  • ianxpring
  • inthecloud247
  • flowhamster