Socket
Book a DemoInstallSign in
Socket

stoopid

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stoopid

Loggers are stupid and I'm resentful that I had to write this.

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

stoopid -- Loggers are stupid and I'm resentful that I had to write this.

Install

  npm install stoopid

Or from source:

  git clone git://github.com/mikeal/stoopid.git 
  cd stoopid
  npm link

Usage

stoopid.log('I am a robot', {prop:'value'})

The stoopid module exports itself as an instance of Logger with the namespace "process".

You can create child logger objects with new namespaces with the .logger(name) method.

var logger = require('stoopid').logger('myModuleName')

A logger object supports all the same methods that the console object in node supports and has a nearly identical API. It also supports all the methods necessary to be enabled as a logger in socket.io.

console logging is enabled by default.

Logger(name)

Base logger object.

stoopid API

  • Logger.logger(name) - Create a new instance of logger with this logger as it's parent.
  • Logger.addHandler(handler, options) - Add a handler, "console" and "file" are supported.
  • Logger.silly(arg1, arg2, ...) - Logs at level "silly" or 10
  • Logger.verbose(arg1, arg2, ...): - Logs at level "verbose" or 100
  • Logger.debug(arg1, arg2, ...): - Logs at level "info" or 200
  • Logger.info(arg1, arg2, ...): - Logs at level "info" or 300
  • Logger.warn(arg1, arg2, ...): - Logs at level "warn" or 400
  • Logger.error(arg1, arg2, ...): - Logs at level "error" or 500

console API

All the additional methods necessary to be used as a replacement for node.js' global console object are also supported.

  • Logger.log(arg1, arg2, ...) - Logs at level "info" or 300.
  • Logger.dir(arg1, arg2, ...) - Logs at level "info" or 300.
  • Logger.time(label) - Mark a timer. http://nodejs.org/api/stdio.html#console.time
  • Logger.timeEnd(label) - Finish timer, record output. http://nodejs.org/api/stdio.html#console.timeEnd
  • Logger.trace(label) - Log at "error" level a stack trace to stderr in the current position. http://nodejs.org/api/stdio.html#console.trace
  • Logger.assert(expression) - http://nodejs.org/api/stdio.html#console.assert

FAQs

Package last updated on 07 Mar 2012

Did you know?

Socket

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.

Install

Related posts