src/util/logger.js
function pushLogEntry(logEntry) {
    var logger = window[appSettings.loggerVar];
    if (logger) {
        logger.logs.push(logEntry);

        if (window.console) {
            if (typeof console.error === "function" && typeof console.warn === "function") {
                switch (logEntry.type) {
                    case enumerations.logType.wtf:
                        console.error(toFriendlyString(logEntry));
                        break;
                    case enumerations.logType.error:
                        if (appSettings.logLevel <= enumerations.logLevel.error && appSettings.logLevel > enumerations.logLevel.off) {
                            console.error(toFriendlyString(logEntry));
                        }
                        break;
                    case enumerations.logType.warning:
                        if (appSettings.logLevel <= enumerations.logLevel.warn && appSettings.logLevel > enumerations.logLevel.off) {
                            console.warn(toFriendlyString(logEntry));
                        }
                        break;
                    default:
                        if (appSettings.logLevel <= enumerations.logLevel.debug && appSettings.logLevel > enumerations.logLevel.off) {
                            console.log(toFriendlyString(logEntry));
                            break;
                        }
                }

            } else {
                console.log(toFriendlyString(logEntry));
            }
        }
    }
}
function pushLogEntry(logEntry) {
    var logger = window[appSettings.loggerVar];
    if (logger) {
        logger.logs.push(logEntry);

        if (window.console) {
            if (typeof console.error === "function" && typeof console.warn === "function") {
                switch (logEntry.type) {
                    case enumerations.logType.wtf:
                        console.error(toFriendlyString(logEntry));
                        break;
                    case enumerations.logType.error:
                        if (appSettings.logLevel <= enumerations.logLevel.error && appSettings.logLevel > enumerations.logLevel.off) {
                            console.error(toFriendlyString(logEntry));
                        }
                        break;
                    case enumerations.logType.warning:
                        if (appSettings.logLevel <= enumerations.logLevel.warn && appSettings.logLevel > enumerations.logLevel.off) {
                            console.warn(toFriendlyString(logEntry));
                        }
                        break;
                    default:
                        if (appSettings.logLevel <= enumerations.logLevel.debug && appSettings.logLevel > enumerations.logLevel.off) {
                            console.log(toFriendlyString(logEntry));
                            break;
                        }
                }

            } else {
                console.log(toFriendlyString(logEntry));
            }
        }
    }
}
function pushLogEntry ( logEntry ) { var logger = window [ appSettings . loggerVar ] ; if ( logger ) { logger . logs . push ( logEntry ) ; if ( window . console ) { if ( typeof console . error === "function" && typeof console . warn === "function" ) { switch ( logEntry . type ) { case enumerations . logType . wtf : console . error ( toFriendlyString ( logEntry ) ) ; break ; case enumerations . logType . error : if ( appSettings . logLevel <= enumerations . logLevel . error && appSettings . logLevel > enumerations . logLevel . off ) { console . error ( toFriendlyString ( logEntry ) ) ; } break ; case enumerations . logType . warning : if ( appSettings . logLevel <= enumerations . logLevel . warn && appSettings . logLevel > enumerations . logLevel . off ) { console . warn ( toFriendlyString ( logEntry ) ) ; } break ; default : if ( appSettings . logLevel <= enumerations . logLevel . debug && appSettings . logLevel > enumerations . logLevel . off ) { console . log ( toFriendlyString ( logEntry ) ) ; break ; } } } else { console . log ( toFriendlyString ( logEntry ) ) ; } } } }
Push a logEntry to the array of logs and output it to the console
@param logEntry The logEntry to process
Push a logEntry to the array of logs and output it to the console