Socket
Book a DemoInstallSign in
Socket

bunyan-console-stream

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bunyan-console-stream

simple bunyan console logging stream

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Simple bunyan console logging stream

Logs bunyan message text to STDOUT. Output is directed to STDERR if a message's level ("fatal" (60), "error" (50), "warn" (40), "info" (30), "debug" (20), "trace" (10)) is greater or equals the value set by option stderrThreshold:

var bunyan = require('bunyan'); 
var consoleStream = require('bunyan-console-stream'); 
// ...

var stream_options = {
                       stderrThreshold:40 //log warning, error and fatal messages on STDERR
                     };

var logger = bunyan.createLogger({
  								  name: loggerName,
            				      streams: [
                  				    		{
                	  			    			type: 'raw',
                		  		    			stream: consoleStream.createStream(stream_options)
                					        },
                					        //...
                					 	]
            			        });
// ...             			        
logger.info('Success!');   // STDOUT output: INFO: Success!         			        
logger.error('Fail.');     // STDERR output: ERROR: Fail.

Keywords

bunyan

FAQs

Package last updated on 19 Feb 2016

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