How to use the loglevel.hasOwnProperty function in loglevel

To help you get started, we’ve selected a few loglevel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adobe-photoshop / spaces-design / src / js / util / log.js View on Github external
define(function (require, exports, module) {
    "use strict";

    var loglevel = require("loglevel");

    /*eslint no-console:0*/

    if (__PG_DEBUG__) {
        // If the debug global is set, log messages at and below debug level
        loglevel.enableAll();

        if (!loglevel.hasOwnProperty("table")) {
            loglevel.table = console.table.bind(console);
        }
    } else {
        // Otherwise, only log information, warnings and errors
        loglevel.setLevel(loglevel.levels.INFO);
    }

    if (!loglevel.hasOwnProperty("timeStamp")) {
        loglevel.timeStamp = console.timeStamp.bind(console);
    }

    module.exports = loglevel;
});
github adobe-photoshop / spaces-design / src / js / util / log.js View on Github external
/*eslint no-console:0*/

    if (__PG_DEBUG__) {
        // If the debug global is set, log messages at and below debug level
        loglevel.enableAll();

        if (!loglevel.hasOwnProperty("table")) {
            loglevel.table = console.table.bind(console);
        }
    } else {
        // Otherwise, only log information, warnings and errors
        loglevel.setLevel(loglevel.levels.INFO);
    }

    if (!loglevel.hasOwnProperty("timeStamp")) {
        loglevel.timeStamp = console.timeStamp.bind(console);
    }

    module.exports = loglevel;
});