"use strict";
var IOSLogFilter = (function () {
    function IOSLogFilter($loggingLevels) {
        this.$loggingLevels = $loggingLevels;
    }
    IOSLogFilter.prototype.filterData = function (data, logLevel, pid) {
        if (pid && data && data.indexOf("[" + pid + "]") === -1) {
            return null;
        }
        if (data) {
            if (data.indexOf("SecTaskCopyDebugDescription") !== -1 ||
                data.indexOf("NativeScript loaded bundle") !== -1 ||
                (data.indexOf("assertion failed:") !== -1 && data.indexOf("libxpc.dylib") !== -1)) {
                return null;
            }
            var logIndex = data.indexOf("CONSOLE LOG");
            if (logIndex !== -1) {
                var i = 4;
                while (i) {
                    logIndex = data.indexOf(':', logIndex + 1);
                    i--;
                }
                if (logIndex > 0) {
                    data = "JS:" + data.substring(logIndex + 1, data.length);
                }
            }
            return data.trim();
        }
        return data;
    };
    return IOSLogFilter;
}());
exports.IOSLogFilter = IOSLogFilter;
$injector.register("iOSLogFilter", IOSLogFilter);
