<commit_before>namespace('Sy.Lib.Logger.Handler');

Sy.Lib.Logger.Handler.Console = function (level) {

    this.level = null;

    this.setLevel(level);

};

Sy.Lib.Logger.Handler.Console.prototype = Object.create(Sy.Lib.Logger.Handler.Interface.prototype, {

    setLevel: {
        value: function (level) {

            if (!this.checkLevel(level)) {
                throw new TypeError('Unknown logger level');
            }

            this.level = level;

            return this;

        }
    },

    checkLevel: {
        value: function (level) {

            if (level.toUpperCase() in Sy.Lib.Logger.CoreLogger.prototype) {
                return true;
            }

            return false;

        }
    },

    isHandling: {
        value: function (level) {

            if (level === this.level) {
                return true;
            }

            return false;

        }
    },

    handle: {
        value: function (level, message, data) {

            if (this.isHandling(level) && 'console' in window) {

                var output = '[' + moment().format('YYYY-M-D hh:mm:ss') + ']',
                    extra = data || [];

                output += ' ' + message.toString() + ' ' + JSON.stringify(extra);

                console[level](output);

            }

            return this;

        }
    }

});<commit_msg>instead of stringifying the extra data, output it as is (better for object exploration)<commit_after>namespace('Sy.Lib.Logger.Handler');

Sy.Lib.Logger.Handler.Console = function (level) {

    this.level = null;

    this.setLevel(level);

};

Sy.Lib.Logger.Handler.Console.prototype = Object.create(Sy.Lib.Logger.Handler.Interface.prototype, {

    setLevel: {
        value: function (level) {

            if (!this.checkLevel(level)) {
                throw new TypeError('Unknown logger level');
            }

            this.level = level;

            return this;

        }
    },

    checkLevel: {
        value: function (level) {

            if (level.toUpperCase() in Sy.Lib.Logger.CoreLogger.prototype) {
                return true;
            }

            return false;

        }
    },

    isHandling: {
        value: function (level) {

            if (level === this.level) {
                return true;
            }

            return false;

        }
    },

    handle: {
        value: function (level, message, data) {

            if (this.isHandling(level) && 'console' in window) {

                var output = '[' + moment().format('YYYY-M-D hh:mm:ss') + ']',
                    extra = data || [];

                output += ' ' + message.toString();

                console[level](output, extra);

            }

            return this;

        }
    }

});
{'fraction_non_alphanumeric': 0.13137893593919653, 'fraction_numerical': 0.0, 'mean_word_length': 1.4656556645851917, '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': '517779', 'n_tokens_mistral': 810, 'n_tokens_neox': 746, 'n_words': 153}