all files / dist/utils/ Logger.js

100% Statements 31/31
100% Branches 2/2
100% Functions 13/13
100% Lines 31/31
1 function Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48      10×     15×               20× 11×          
"use strict";
var Logger = (function () {
    /* istanbul ignore next */ function Logger() {
    }
    Logger.getIsEnabled = function () {
        return this.isEnabled;
    };
    Logger.enable = function () {
        this.setEnabled(true);
    };
    Logger.disable = function () {
        this.setEnabled(false);
    };
    Logger.setEnabled = function (isEnabled) {
        this.isEnabled = isEnabled;
    };
    Logger.setLogFunction = function (logFunction) {
        this.logFunction = logFunction;
    };
    Logger.setWarnFunction = function (warnFunction) {
        this.warnFunction = warnFunction;
    };
    Logger.setErrorFunction = function (errorFunction) {
        this.errorFunction = errorFunction;
    };
    Logger.log = function (message) {
        this.logWithFunction(message, this.logFunction);
    };
    Logger.warn = function (message) {
        this.logWithFunction(message, this.warnFunction);
    };
    Logger.error = function (message) {
        this.logWithFunction(message, this.errorFunction);
    };
    Logger.logWithFunction = function (message, func) {
        if (this.isEnabled)
            func("[ts-type-info]: " + message);
    };
    Logger.isEnabled = false;
    Logger.logFunction = console.log;
    Logger.warnFunction = console.warn;
    Logger.errorFunction = console.error;
    return Logger;
}());
exports.Logger = Logger;
 
//# sourceMappingURL=Logger.js.map