Modified to support namespaced debug to bunyan.
Install the module with: yarn add https://github.com/HackCapital/feathers-logger
var feathers = require('feathers');
var logger = require('feathers-logger');
var app = feathers()
.configure(logger({ name: 'cto-ai' }));
Feathers-logger
enables the following methods:
app.log()
app.info()
app.warn()
app.error()
app.debug()
app.createDebug()
var feathers = require('feathers');
var logger = require('feathers-logger');
var app = feathers()
.configure(logger({name: 'cto-ai'}));
app.log('Some log happened');
app.info('Some info happened');
app.warn('Some warn happened');
app.error('Some error happened');
// The following debug will only appear if app is started with: DEBUG=cto-ai
app.debug('Some debug happened');
// The following debug will only appear if app is started with: DEBUG=cto-ai:some-namespace
const namespacedDebug = app.createDebug('some-namespace');
namespacedDebug('Some debug happened');
Start the app with a debug level. Ie. DEBUG=*
, DEBUG=cto-ai*
, DEBUG=cto-ai:my-namespace*
to filter the debug messages that appear.
More info: Node Debug
See example directory.
Copyright (c) 2014 Eric Kryski Licensed under the MIT license.