var uniflashs;
(function (uniflashs) {
    var Logger = (function () {
        function Logger() {
            this.printToConsole = false;
            this.logObj = [];
        }
        Logger.prototype.clean = function () {
            this.logObj = [];
        };
        Logger.prototype.log = function (arg) {
            this.logObj.push(arg);
        };
        Logger.prototype.getLogObjStr = function () {
            var ret = '';
            _.each(this.logObj, function (line) {
                ret += line + '\n';
            });
            return ret;
        };
        Logger.prototype.save = function () {
            function isSafari() {
                return 'safari' === TICloudAgent.getBrowser();
            }
            var logObjStr = this.getLogObjStr();
            if (isSafari()) {
                var base64data = btoa(logObjStr);
                window.location.href = 'data:text/plain;charset=utf-8;base64,' + base64data;
            }
            else {
                var textFileAsBlob = new Blob([logObjStr], { type: 'text/plain;charset=utf-8' });
                saveAs(textFileAsBlob, 'uniflash_gui_debug_log');
            }
        };
        Logger.$inject = [];
        return Logger;
    }());
    angular.module('uniflash').service('ufLogger', Logger);
})(uniflashs || (uniflashs = {}));
