A JavaScript logging library, largely inspired by the Python logging module.
A simple example:
var logger = spindle.Logger.get('foo.bar');
logger.setLevel(spindle.Logger.levels.DEBUG);
logger.debug('a debug message');
// Calls: console.log('[foo.bar] a debug message')
logger.warning('a warning message');
// Calls: console.warn('[foo.bar] a warning message')
Using bower:
$ bower install spindle
Spindle depends on underscore.js.
Spindle works both with and without AMD (RequireJS).
For more information, see the examples.
0.2.1 (under development)
- Fixed the path to the JavaScript source maps in spindle.js
- Fix: the
returnFirstHandler
is now only explicitly set when actually passed
0.2
-
returnFirstHandler
now defaults totrue
instead offalse
:# old API: Logger.get('foo').debug('call from spindle.js') Logger.get('foo', true).debug('call from your code')() # new API: Logger.get('foo').debug('call from your code')() Logger.get('foo').debug('this does nothing') # simple returns a function to be called Logger.get('foo', false).debug('call from spindle.js')
0.1
- First public release; just getting it out there.
- Create tests
- Formatters
spindle.js
started as part of the Goeie Jongens HTML5 toolkit.