<commit_before>'use strict';

  /**
   * Provides functions to manage loggers.
   *
   * @module logger
   * @class logger
   * @main logger
   */

// Module dependencies
var winston = require('winston');

/**
 * Gets a new logger by its name or initializes one.
 *
 * @example
 *     var loggerAPI = require('@openveo/api').logger;
 *
 *     var conf =  {
 *      'fileName' : '/tmp/openveo/logs/openveo.log',
 *      'level' : 'debug',
 *      'maxFileSize' : 1048576,
 *      'maxFiles' : 2
 *     };
 *
 *     // Initializes logger "openveo"
 *     var logger = loggerAPI.get('openveo', conf);
 *
 *     // Log something
 *     logger.info('A simple log');
 *
 * @example
 *     var loggerAPI = require('@openveo/api').logger;
 *
 *     // Retrieve logger "openveo" which have already been initialized
 *     var logger = loggerAPI.get('openveo');
 *
 * @method get
 * @param {String} name The name of the logger
 * @param {Object} [conf] Logger configuration to initialize a new logger
 * Available debug levels are :
 *  - silly
 *  - debug
 *  - verbose
 *  - info
 *  - warn
 *  - error
 */
module.exports.get = function(name, conf) {
  if (conf) {

    // Create logger
    winston.loggers.add(name, {
      file: {
        level: conf.level,
        filename: conf.fileName,
        maxsize: conf.maxFileSize,
        maxFiles: conf.maxFiles
      }
    });
  }

  return winston.loggers.get(name);
};
<commit_msg>Remove default logger, which log to the standard output<commit_after>'use strict';

  /**
   * Provides functions to manage loggers.
   *
   * @module logger
   * @class logger
   * @main logger
   */

// Module dependencies
var winston = require('winston');

/**
 * Gets a new logger by its name or initializes one.
 *
 * @example
 *     var loggerAPI = require('@openveo/api').logger;
 *
 *     var conf =  {
 *      'fileName' : '/tmp/openveo/logs/openveo.log',
 *      'level' : 'debug',
 *      'maxFileSize' : 1048576,
 *      'maxFiles' : 2
 *     };
 *
 *     // Initializes logger "openveo"
 *     var logger = loggerAPI.get('openveo', conf);
 *
 *     // Log something
 *     logger.info('A simple log');
 *
 * @example
 *     var loggerAPI = require('@openveo/api').logger;
 *
 *     // Retrieve logger "openveo" which have already been initialized
 *     var logger = loggerAPI.get('openveo');
 *
 * @method get
 * @param {String} name The name of the logger
 * @param {Object} [conf] Logger configuration to initialize a new logger
 * Available debug levels are :
 *  - silly
 *  - debug
 *  - verbose
 *  - info
 *  - warn
 *  - error
 */
module.exports.get = function(name, conf) {
  if (conf) {

    // Create logger
    winston.loggers.add(name, {
      file: {
        level: conf.level,
        filename: conf.fileName,
        maxsize: conf.maxFileSize,
        maxFiles: conf.maxFiles
      }
    });

    // Remove default logger, which log to the standard output, in production environment
    if (process.env.NODE_ENV == 'production')
      winston.loggers.get(name).remove(winston.transports.Console);
  }

  return winston.loggers.get(name);
};

{'fraction_non_alphanumeric': 0.13990306946688208, 'fraction_numerical': 0.005169628432956382, 'mean_word_length': 2.4209944751381216, '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': '5579940', 'n_tokens_mistral': 1012, 'n_tokens_neox': 991, 'n_words': 260}