"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const device_log_provider_base_1 = require("./device-log-provider-base");
const constants_1 = require("../constants");
const constants_2 = require("../../constants");
class DeviceLogProvider extends device_log_provider_base_1.DeviceLogProviderBase {
    constructor($logFilter, $logger) {
        super($logFilter, $logger);
        this.$logFilter = $logFilter;
        this.$logger = $logger;
    }
    logData(lineText, platform, deviceIdentifier) {
        const loggingOptions = this.getDeviceLogOptionsForDevice(deviceIdentifier);
        const data = this.$logFilter.filterData(platform, lineText, loggingOptions);
        if (data) {
            this.logDataCore(data);
            this.emit(constants_1.DEVICE_LOG_EVENT_NAME, lineText, deviceIdentifier, platform);
        }
    }
    setLogLevel(logLevel, deviceIdentifier) {
        this.$logFilter.loggingLevel = logLevel.toUpperCase();
    }
    logDataCore(data) {
        this.$logger.info(data, { [constants_2.LoggerConfigData.skipNewLine]: true });
    }
}
exports.DeviceLogProvider = DeviceLogProvider;
$injector.register("deviceLogProvider", DeviceLogProvider);
