AsyncConsole.prototype.log = function()

in lib/async-console-transport.js [76:113]


AsyncConsole.prototype.log = function (level, msg, meta, callback) {
  if (this.silent) {
    return callback(null, true);
  }

  var self = this,
      output;

  output = common.log({
    colorize:    this.colorize,
    json:        this.json,
    level:       level,
    message:     msg,
    meta:        meta,
    stringify:   this.stringify,
    timestamp:   this.timestampFormat ? function() {
      return format(self.timestampFormat, new Date());
    } : this.timestamp,
    prettyPrint: this.prettyPrint,
    raw:         this.raw,
    label:       this.label
  });

  if (level === 'error' || level === 'debug') {
    process.stderr.write(output + '\n', onwrite);
  } else {
    process.stdout.write(output + '\n', onwrite);
  }

  function onwrite(err) {
    if (err) {
      return callback(err);
    }

    self.emit('logged');
    callback(null, true);
  }
};