crucial javascript

Jun 30, 2015

jacob:

<script>
    var enable_logging = true;

    function _log(){
        if (enable_logging && window.console && window.console.log) {
            window.console.log.apply(window.console, arguments);
        }
    }
    function _error(){
        if (enable_logging && window.console && window.console.error) {
            window.console.error.apply(window.console, arguments);
        }
    }
    function _debug(){
        if (enable_logging && window.console && window.console.debug) {
            window.console.debug.apply(window.console, arguments);
        }
    }
</script>