2.0.2 • Published 5 years ago

superconsole v2.0.2

Weekly downloads
39
License
MIT
Repository
github
Last release
5 years ago

superconsole

Note : Mostly a fork of console-trace created by Learnboost with more options.

Extends the native Node.JS console object to prefix logging functions with the CallSite information, timestamp and log level.

To read more about runtime stack trace introspection you can refer to this article.

Installation

$ npm install superconsole

Syntax:

require('superconsole')([options])

Available Options:

  • callsite - (Boolean: defaults to false) prepend the callsite info even without accessing methods from the t or traced getters.
  • level - (Boolean : defaults to false) prepend the log level to the log
  • timestamp - (Boolean : defaults to false) prepend the ISO Date to the log
  • logLevel - (String : defaults to "debug") call to consolelevel under logLevel will be skipped
  • cwd - (String: defaults to process.cwd()) the path that will be stripped from the callsite info
  • colors - (Boolean|Object: defaults to true) terminal colors support flag or a custom color object
  • right - (Boolean: defaults to false) callsite alignment flag, when true prints infos on the right

Examples:

require('superconsole')

You can add the t or traced getter to your calls to obtain a stacktrace:

console.t.log('a');
console.traced.log('a');

Or:

require('superconsole')({
  callsite: true,
  level : true,
  timestamp : true,
  logLevel : 'info'
})

Credits

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.0

7 years ago

0.1.2

7 years ago

0.1.1

11 years ago

0.1.0

12 years ago