How to use the winston-transport.Mail function in winston-transport

To help you get started, we’ve selected a few winston-transport 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 satoripop / thesuperlogger / src / transports / winston-mail.js View on Github external
this.transporter = nodemailer.createTransport(
    options.transportOptions
  );
}

/**
 * Inherit from `winston.Transport`.
 */
util.inherits(Mail, Transport);

/**
 * Define a getter so that `winston.transports.Mail`
 * is available and thus backwards compatible.
 */
Transport.Mail = Mail;

/**
 * Core logging method exposed to Winston. Metadata is optional.
 * @param {object} info **Optional** Additional metadata to attach
 * @param {Function} cb Continuation to respond to when complete.
 */
Mail.prototype.log = function(info, cb) {
  var self = this
  let level = info[LEVEL];
  if (levels[level] != levels[lowestLevel] && levels[level] >= levels[this.level]){
    if(cb) cb(null, true)
    return;
  }

  let body;
  let env  = (process.env.APP_ENV || "prod").toUpperCase();

winston-transport

Base stream implementations for winston@3 and up.

MIT
Latest version published 17 days ago

Package Health Score

89 / 100
Full package analysis