logtrail

0.1.0 • Public • Published

Logtrail

Logtrail is an ambitious general-purpose logging module for Node.js. The current objectives for logtrail include:

  • Custom Log Types: Add your own log type - or don't - the default ones work pretty well for most scenarios.
  • Colors and Timestamps: Fancy log entries - or not - it can be disabled.
  • Loglevels and Thresholding: Depending on the environment, certain log types might not need to be printed.
  • Writing Logs to Files: A must have feature for any logger!
  • Custom Callbacks: Send logs to Papertrail or any other TCP destination.
  • Default Logger: Hijack the native console.log, console.err and console.warn

TODO (Transitional)

  • add capability: write to files (strip colors)
  • add capability: set loglevel without reconfiguring
  • add capability: extend log types
  • write test: logtrail core

Usage

var logtrail = require('logtrail');
 
logtrail.configure({
    timestamp: true,
    stacktrace: true,
    loglevel: 'info'
});
 
// loglevels:
// fatal
// error
// warn
// info
// trace
 

Package Sidebar

Install

npm i logtrail

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • matejkramny