Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 600 Bytes

README.md

File metadata and controls

35 lines (24 loc) · 600 Bytes

winston-memory

Memory logger for winston

Install

$ npm install winston-memory

Use

Hook it up to winston like this:

var winston = require('winston');
require('winston-memory').Memory;

winston.add(winston.transports.Memory);
winston.remove(winston.transports.Console);

And you're ready to go. When you need to access your logged info, just access:

var transport = winston['default'].transports['memory'];

// Arrays with output and error lines
var outputs = transport.writeOutput;
var errors = transport.errorOutput;