console-log-level alternatives and similar modules
Based on the "Logging" category.
Alternatively, view console-log-level alternatives based on common mentions on social networks and blogs.
-
Bunyan
a simple and fast JSON logging module for node.js services -
tracer for node.js
A powerful and customizable logging library for node.js -
storyboard
End-to-end, hierarchical, real-time, colorful logs and stories -
log-process-errors
Show some ❤️ to Node.js process errors -
What projects belong to here?
Better logging messages for Nodejs developers -
Consono
The most correct, informative, appealing and configurable variable inspector for JavaScript -
oddlog
A high-performance payload focused logging library for node.js
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of console-log-level or a related project?
README
console-log-level
A dead simple logger. Will log to STDOUT or STDERR depending on the
chosen log level. It uses console.info
, console.warn
and
console.error
and hence supports the same API.
Log levels supported: trace, debug, info, warn, error and fatal.
Installation
npm install console-log-level
Example usage
var log = require('console-log-level')({ level: 'info' })
log.trace('a') // will not do anything
log.debug('b') // will not do anything
log.info('c') // will output 'c\n' on STDOUT
log.warn('d') // will output 'd\n' on STDERR
log.error('e') // will output 'e\n' on STDERR
log.fatal('f') // will output 'f\n' on STDERR
Options
Configure the logger by passing an options object:
var log = require('console-log-level')({
prefix: function (level) {
return new Date().toISOString()
},
level: 'info'
})
level
A string
to specify the log level. Defaults to info
.
prefix
Specify this option if you want to set a prefix for all log messages.
This must be a string
or a function
that returns a string.
Will get the level of the currently logged message as the first argument.
stderr
A boolean
to log everything to stderr. Defauls to false
.
License
[MIT](LICENSE)
*Note that all licence references and agreements mentioned in the console-log-level README section above
are relevant to that project's source code only.