<commit_before>/**
 * # loggers.js
 * Copyright(c) 2021 <NAME>
 * MIT Licensed
 *
 * Configuration file for Winston.js in nodegame-server
 */

module.exports = configure;

const path = require('path');
const winston = require('winston');

// Variable loggers is winston.loggers.
function configure(loggers, logDir) {
    let logLevel = winston.level;

    // ServerNode.
    loggers.add('servernode', {
        transports: [
            new winston.transports.Console({
                level: logLevel,
                colorize: true
            }),
            new winston.transports.File({
                level: logLevel,
                timestamp: true,
                filename: path.join(logDir, 'servernode.log'),
                maxsize: 1000000,
                maxFiles: 10
            })
        ]

    });

    // Channel.
    loggers.add('channel', {
        transports: [
            new winston.transports.Console({
                level: logLevel,
                colorize: true,
            }),
            new winston.transports.File({
                level: logLevel,
                timestamp: true,<commit_msg>minor<commit_after>/**
 * # loggers.js
 * Copyright(c) 2021 <NAME>
 * MIT Licensed
 *
 * Configuration file for Winston.js in nodegame-server
 */

module.exports = configure;

const path = require('path');
const winston = require('winston');

// Variable loggers is winston.loggers.
function configure(loggers, logDir) {
    let logLevel = winston.level;


    // ServerNode.
    loggers.add('servernode', {
        transports: [
            new winston.transports.Console({
                level: logLevel,
                colorize: true
            }),
            new winston.transports.File({
                level: logLevel,
                timestamp: true,
                filename: path.join(logDir, 'servernode.log'),
                maxsize: 1000000,
                maxFiles: 10
            })
        ]

    });

    // Channel.
    loggers.add('channel', {
        transports: [
            new winston.transports.Console({
                level: logLevel,
                colorize: true,
            }),
            new winston.transports.File({
                level: logLevel,
                timestamp: true,
{'fraction_non_alphanumeric': 0.10997782705099779, 'fraction_numerical': 0.011529933481152993, 'mean_word_length': 1.5578231292517006, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1251179', 'n_tokens_mistral': 655, 'n_tokens_neox': 590, 'n_words': 135}