![New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions](https://cdn.sanity.io/images/cgdhsj6q/production/86e6ebdea652d20da070ebbda20134b839972db7-1024x1024.webp?w=800&fit=max&auto=format)
Security News
New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
logger
Advanced tools
A simple logging library that combines the simple APIs of Ruby's logger.rb and browser-js console.log()
Readme
http://github.com/quirkey/node-logger
A simple logging library that combines the simple APIs of Ruby's logger.rb and browser-js console.log()
A logger has 5 different levels of logging in a specific order:
'fatal', 'error', 'warn', 'info', 'debug'
Each of these log levels has its own method on the logging instance. You can set the maximum log level on a logger at runtime.
By default, a logger writes to STDOUT, but given a writeable file path, it will log directly to a file.
// node/common.js style
var logger = require('./logger').createLogger(); // logs to STDOUT
var logger = require('./logger').createLogger('development.log'); // logs to a file
Any of the logging methods take n
arguments, which are each joined by ' ' (similar to console.log()
). If an argument is not a string, it is string-ified by sys.inspect()
logger.info('loading an array', [1,2,3], 'now!');
//=> info [Sat Jun 12 2010 01:12:05 GMT-0400 (EDT)] loading an array [ 1, 2, 3, [length]: 3 ] now!
logger.debug('this wont be logged');
//=> false
logger.setLevel('debug');
logger.debug('this will be logged now');
//=> debug [Sat Jun 12 2010 01:12:54 GMT-0400 (EDT)] this will be logged now
You can completely customize the look of the log by overriding the format()
method on a logger.
logger.format = function(level, date, message) {
return date.getTime().toString() + "; " + message;
};
logger.debug('message');
//=> 1276365362167; message
F-f-fork it, baby.
MIT, see the source.
FAQs
A simple logging library that combines the simple APIs of Ruby's logger.rb and browser-js console.log()
The npm package logger receives a total of 9,727 weekly downloads. As such, logger popularity was classified as popular.
We found that logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Security News
Results from the 2023 State of JavaScript Survey highlight key trends, including Vite's dominance, rising TypeScript adoption, and the enduring popularity of React. Discover more insights on developer preferences and technology usage.
Security News
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.