Provide an isomorphic logging capabilities for OrionJS.
meteor add orionjs:loggingThis package exposes Bunyan within OrionJS.
It declares a reusable logger in OrionJS as orion.log and a default formatter
as orion.log.logFormatter. However in order to separate your application's logs
from the one of OrionJS, we recommend you to instantiate your own logger like so:
// Client and server side
myAppLog = new bunyan.createLogger({
name: 'myApp',
stream: orion.logFormatter,
level: 'info'
});
...
// And using it this way within your app
myAppLog.info('Info level logs');
myAppLog.warn('Warning level logs');
myAppLog.error('Error level logs');
...orion.log.level('none');This is also applicable to your own logs.
// For debug level and aboves
orion.log.level('debug');
...
// For info level and above
orion.log.level('info');
...
// For fatal only level
orion.log.level('fatal');This is also applicable to your own logs.