Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
//