How to use the @awesomeeng/awesome-log.AbstractLogWriter function in @awesomeeng/awesome-log

To help you get started, we’ve selected a few @awesomeeng/awesome-log examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github awesomeeng / awesome-log / examples / ExampleCustomWriter / MyExampleWriter.js View on Github external
An example Writer.

	For this example, we are just going to prepend a one up number to
	each log message.  Other custom writers could do just about anything
	else from writing to a database to vocalizing log messages out to
	and audio source.
 */

"use strict";

// First we need to import AwesomeLog.
const Log = require("@awesomeeng/awesome-log");

// Next we need to expose the AwesomeLog.AbstractLogWriter class which we
// will subclass in just a second.
const AbstractLogWriter = Log.AbstractLogWriter;

// Here's our one up counter.
let counter = 0;

// So here we create our new writer class by subclassing
// AwesomeLog.AbstractLogWriter.
//
// When you subclass AbstractLogWriter you are required to implement
// four specific methods...
//
//		constructor(parent,type,name,levels,formatter,options)
//
// 		write(message,logentry)
//
// 		flush()
//

@awesomeeng/awesome-log

AwesomeLog is a Log System for enterprise nodejs applications. It provides a basic out of the box logging solution that is ready to go with zero configuration but also gives you a highly configurable logging solution that with the power to do your logging

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis