JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 43
  • Score
    100M100P100Q71367F
  • License ISC

Fancy Logging!

Package Exports

  • fancylog

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fancylog) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

📜 Fancy Log

NPM version NPM downloads Build status Dependencies Coverage Status

Fancy Logging!
Written in TypeScript, compiled down to ES5 for use in any Node.js version!

💾 Installation

The package is on the NPM registry as fancylog. Simply install it with your NPM client of choice.

🔧 Usage

First, import the module:

// CommonJS
const log = require('fancylog')

// ES Modules
import * as log from 'fancylog'

From there you can call any of the log level functions:

log.info()
log.debug()
log.error()
log.verbose()
log.warn()

You can also instantiate the FileLogger class to automatically log to a file as well as the console.

// CommonJS
const { FileLogger } = require('fancylog')

// ES Modules
import { FileLogger } from 'fancylog'

const log = new FileLogger('/path/to/file.log')
log.info()

📝 Example Output

Calling:

log.info('hello world')
log.debug('hello world')
log.verbose('hello world')

Would result in:

[14/02/2019 09:02:54] [INFO]    | hello world
[14/02/2019 09:02:54] [DEBUG]   | hello world
[14/02/2019 09:02:54] [VERBOSE] | hello world