<commit_before>/*jshint regexp:false*/

'use strict';

var dejavu = require('dejavu'),
    colors = require('colors'),
    utils  = require('mout'),
    Stream = require('stream')
;

colors.setTheme({
    automaton_debug:   'white',
    automaton_info:    'white',
    automaton_warn:    'yellow',
    automaton_error:   'red',
    automaton_success: 'green'
});

var Logger = dejavu.Class.declare({
    $name: 'Logger',

    _stream: null,
    _padding: '',
    _depth: 1,
    _muted: false,
    _ln: true,
    _options: {
        verbosity: -1,
        debug: false,
        color: true
    },

    /**
     * Constructor.
     *
     * Available options:
     *  - verbosity - 0 means no logging
     *                1 means only 1 deep level tasks and so on..
     *                -1 means log every level
     *  - debug     - true to log debug messages, false otherwise
     *  - color     - true to keep colors in messages, false otherwise
     *
     * @param {Object} [$options] The options
     */
    initialize: function ($options) {
        if ($options) {
            utils.object.deepMixIn(this._options, $options);
        }

        this._stream = new Stream();
        this._stream.writable = false;
    },

    /**
     * Get the read stream for the logger.
     *
     * @return {Stream} The readonly stream
     */
    getStream: function () {
        return this._stream;
    },

    /**
     * Set the current depth.
     *
     * @param {Number} depth The depth
     *
     * @return {Automaton} Chainable!
     */
    setDepth: function (depth) {
        this._depth = depth < 1 ? 1 : depth;
        this._padding = this._depth > 1 ? utils.string.repeat('  ', this._depth - 1) : '';

        return this;
    },

    /**
     * Mutes the logger.
     *
     * @return {Automaton} Chainable!
     */
    mute: function () {
        this._muted = true;

        return this;
    },

    /**
     * Unmutes the logger.
     *
     * @return {Automaton} Chainable!
     */
    unmute: function () {
        this._muted = false;

        return this;
    },

    /**
     * Check if the logger is muted.
     *
     * @return {Boolean} True if muted, false otherwise
     */<commit_msg>Doc typo.s<commit_after>/*jshint regexp:false*/

'use strict';

var dejavu = require('dejavu'),
    colors = require('colors'),
    utils  = require('mout'),
    Stream = require('stream')
;

colors.setTheme({
    automaton_debug:   'white',
    automaton_info:    'white',
    automaton_warn:    'yellow',
    automaton_error:   'red',
    automaton_success: 'green'
});

var Logger = dejavu.Class.declare({
    $name: 'Logger',

    _stream: null,
    _padding: '',
    _depth: 1,
    _muted: false,
    _ln: true,
    _options: {
        verbosity: -1,
        debug: false,
        color: true
    },

    /**
     * Constructor.
     *
     * Available options:
     *  - verbosity - 0 means no logging
     *                1 means only 1 deep level tasks and so on..
     *                -1 means log every level
     *  - debug     - true to log debug messages, false otherwise
     *  - color     - true to keep colors in messages, false otherwise
     *
     * @param {Object} [$options] The options
     */
    initialize: function ($options) {
        if ($options) {
            utils.object.deepMixIn(this._options, $options);
        }

        this._stream = new Stream();
        this._stream.writable = false;
    },

    /**
     * Get the read stream for the logger.
     *
     * @return {Stream} The readonly stream
     */
    getStream: function () {
        return this._stream;
    },

    /**
     * Set the current depth.
     *
     * @param {Number} depth The depth
     *
     * @return {Logger} Chainable!
     */
    setDepth: function (depth) {
        this._depth = depth < 1 ? 1 : depth;
        this._padding = this._depth > 1 ? utils.string.repeat('  ', this._depth - 1) : '';

        return this;
    },

    /**
     * Mutes the logger.
     *
     * @return {Logger} Chainable!
     */
    mute: function () {
        this._muted = true;

        return this;
    },

    /**
     * Unmutes the logger.
     *
     * @return {Logger} Chainable!
     */
    unmute: function () {
        this._muted = false;

        return this;
    },

    /**
     * Check if the logger is muted.
     *
     * @return {Boolean} True if muted, false otherwise
     */
{'fraction_non_alphanumeric': 0.1287465940054496, 'fraction_numerical': 0.004541326067211626, 'mean_word_length': 1.717458359037631, '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': '5164845', 'n_tokens_mistral': 1392, 'n_tokens_neox': 1351, 'n_words': 367}