<commit_before>/*
 * Miscellaneous utility functions for mailbox alert
 */

MailboxAlertUtil = {}

MailboxAlertUtil.getInterface = function (iff) {
    var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
    var interface = windowManager.QueryInterface(iff);
    return interface;
}

MailboxAlertUtil.init = function () {
    var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
    if (prefs.prefHasUserValue("extensions.mailboxalert.loglevel")) {
        MailboxAlertUtil.logLevel = prefs.getIntPref("extensions.mailboxalert.loglevel");
    } else {
        MailboxAlertUtil.logLevel = 0;
        MailboxAlertUtil.logLevel = prefs.setIntPref("extensions.mailboxalert.loglevel", "0");
    }
    MailboxAlertUtil.console = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
}

MailboxAlertUtil.init();

MailboxAlertUtil.logMessage = function (level, msg) {
    if (level >= MailboxAlertUtil.logLevel) {
        MailboxAlertUtil.console.logStringMessage("[MailboxAlert] " + msg);
    }
}

MailboxAlertUtil.logStart = function (name) {
    MailboxAlertUtil.logMessage(5, name + " called");
}

MailboxAlertUtil.logEnd = function (name, reason) {
    if (reason) {
        MailboxAlertUtil.logMessage(5, name + " finished (" + reason + ")");
    } else {
        MailboxAlertUtil.logMessage(5, name + " finished");
    }
}<commit_msg>removed extensive function call logging<commit_after>/*
 * Miscellaneous utility functions for mailbox alert
 */

MailboxAlertUtil = {}

MailboxAlertUtil.getInterface = function (iff) {
    var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
    var interface = windowManager.QueryInterface(iff);
    return interface;
}

MailboxAlertUtil.init = function () {
    var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
    if (prefs.prefHasUserValue("extensions.mailboxalert.loglevel")) {
        MailboxAlertUtil.logLevel = prefs.getIntPref("extensions.mailboxalert.loglevel");
    } else {
        MailboxAlertUtil.logLevel = 0;
        MailboxAlertUtil.logLevel = prefs.setIntPref("extensions.mailboxalert.loglevel", "0");
    }
    MailboxAlertUtil.console = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
}

MailboxAlertUtil.init();

MailboxAlertUtil.logMessage = function (level, msg) {
    if (level >= MailboxAlertUtil.logLevel) {
        MailboxAlertUtil.console.logStringMessage("[MailboxAlert] " + msg);
    }
}

MailboxAlertUtil.logStart = function (name) {
    //MailboxAlertUtil.logMessage(5, name + " called");
}

MailboxAlertUtil.logEnd = function (name, reason) {
    /*
    if (reason) {
        MailboxAlertUtil.logMessage(5, name + " finished (" + reason + ")");
    } else {
        MailboxAlertUtil.logMessage(5, name + " finished");
    }
    */
}
{'fraction_non_alphanumeric': 0.130779392338177, 'fraction_numerical': 0.005284015852047556, 'mean_word_length': 4.323374340949034, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6606498', 'n_tokens_mistral': 924, 'n_tokens_neox': 921, 'n_words': 136}