Skip to content

HackCapital/feathers-logger

 
 

Repository files navigation

feathers-logger

Modified to support namespaced debug to bunyan.

Getting Started

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' }));

Documentation

Feathers-logger enables the following methods:

  • app.log()
  • app.info()
  • app.warn()
  • app.error()
  • app.debug()
  • app.createDebug()

Usage

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');

CLI Usage

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

Examples

See example directory.

License

Copyright (c) 2014 Eric Kryski Licensed under the MIT license.

About

A little wrapper for convenient logging in feathers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%