"use strict";
class IOSLogFilter {
    constructor($loggingLevels) {
        this.$loggingLevels = $loggingLevels;
    }
    filterData(data, logLevel, projectDir, pid) {
        let specifiedLogLevel = (logLevel || '').toUpperCase();
        if (specifiedLogLevel === this.$loggingLevels.info) {
            if (pid) {
                return data && data.indexOf(`[${pid}]`) !== -1 ? data.trim() : null;
            }
            let matchingInfoMessage = data.match(IOSLogFilter.INFO_FILTER_REGEX);
            return matchingInfoMessage ? matchingInfoMessage[2] : null;
        }
        return data;
    }
}
IOSLogFilter.INFO_FILTER_REGEX = /^.*?(AppBuilder|Cordova|NativeScript).*?(<Notice>:.*?|<Warning>:.*?|<Error>:.*?)$/im;
exports.IOSLogFilter = IOSLogFilter;
$injector.register("iOSLogFilter", IOSLogFilter);
