<commit_before>'use strict';

var fs = require('fs'),
    path = require('path'),
    benchmark = require('benchmark'),
    winston3 = require('winston'),
    winston2 = require('winston2'),
    winston1 = require('winston1'),
    bunyan = require('bunyan');

module.exports = function (opts) {
  opts = opts || {};

  var max = opts.max || 10000;
  var message = opts.message || 'A logging message that is reasonable long';

  var suite = new benchmark.Suite();

  var loggers = {
    winston1: new winston1.Logger({
      transports: [
        new winston1.transports.Console()
      ]
    }),
    winston2: new winston2.Logger({
      transports: [
        new winston2.transports.Console({ raw: true })
      ]
    }),
    winston3: new winston3.LogStream({
      transports: [
        new winston3.transports.Console()
      ]
    }),
    bunyan: bunyan.createLogger({
      name: 'benchmark',
      stream: process.stdout
    })
  }

  // suite.add('winston1', function () {
  //   loggers.winston1.log('info', message);
  // });

  suite.add('winston2', function () {
    loggers.winston2.log('info', message);
  });

  suite.add('winston3', function () {
    loggers.winston3.write({
      level: 'info',
      message: message,
      meta: { ok: true }
    });
  });

  // suite.add('bunyan', function () {
  //   loggers.bunyan.info({ message: message });
  // });

  return suite;
};<commit_msg>[api] (Re)enable winston1 and bunyan<commit_after>'use strict';

var fs = require('fs'),
    path = require('path'),
    benchmark = require('benchmark'),
    winston3 = require('winston'),
    winston2 = require('winston2'),
    winston1 = require('winston1'),
    bunyan = require('bunyan');

module.exports = function (opts) {
  opts = opts || {};

  var max = opts.max || 10000;
  var message = opts.message || 'A logging message that is reasonable long';

  var suite = new benchmark.Suite();

  var loggers = {
    winston1: new winston1.Logger({
      transports: [
        new winston1.transports.Console()
      ]
    }),
    winston2: new winston2.Logger({
      transports: [
        new winston2.transports.Console({ raw: true })
      ]
    }),
    winston3: new winston3.LogStream({
      transports: [
        new winston3.transports.Console()
      ]
    }),
    bunyan: bunyan.createLogger({
      name: 'benchmark',
      stream: process.stdout
    })
  }

  suite.add('winston1', function () {
    loggers.winston1.log('info', message);
  });

  suite.add('winston2', function () {
    loggers.winston2.log('info', message);
  });

  suite.add('winston3', function () {
    loggers.winston3.write({
      level: 'info',
      message: message,
      meta: { ok: true }
    });
  });

  suite.add('bunyan', function () {
    loggers.bunyan.info({ message: message });
  });

  return suite;
};
{'fraction_non_alphanumeric': 0.16471423500177493, 'fraction_numerical': 0.01810436634717785, 'mean_word_length': 2.6644993498049416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4512680', 'n_tokens_mistral': 970, 'n_tokens_neox': 919, 'n_words': 190}