import { LogManager } from 'aurelia-framework';
import * as toastr from 'toastr';
var ToastType;
(function (ToastType) {
    ToastType[ToastType["Info"] = 0] = "Info";
    ToastType[ToastType["Error"] = 1] = "Error";
})(ToastType || (ToastType = {}));
var CustomLogger = (function () {
    function CustomLogger() {
        this.logManager = LogManager.getLogger('application-insights-plugin');
    }
    CustomLogger.prototype.Log = function (message, data, source, showToast) {
        this.LogIt(message, data, source, showToast, ToastType.Info);
    };
    CustomLogger.prototype.LogError = function (message, data, source, showToast) {
        this.LogIt(message, data, source, showToast, ToastType.Error);
    };
    CustomLogger.prototype.LogIt = function (message, data, source, showToast, toastType) {
        source = source ? '[' + source + '] ' : '';
        if (toastType == ToastType.Error) {
            this.logManager.error(message, data);
        }
        else {
            this.logManager.info(message, data);
        }
        if (showToast) {
            if (toastType == ToastType.Error) {
                toastr.error(message);
            }
            else {
                toastr.info(message);
            }
        }
    };
    return CustomLogger;
}());
export { CustomLogger };

//# sourceMappingURL=custom-logger.js.map
