"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FileLogService = void 0;
const os_1 = require("os");
const helpers_1 = require("../common/helpers");
class FileLogService {
    constructor($fs, logFile) {
        this.$fs = $fs;
        this.logFile = logFile;
    }
    logData(fileLoggingMessage) {
        if (this.logFile && fileLoggingMessage && fileLoggingMessage.message) {
            fileLoggingMessage.type =
                fileLoggingMessage.type || "Info" /* FileLogMessageType.Info */;
            const formattedDate = (0, helpers_1.getFixedLengthDateString)();
            this.$fs.appendFile(this.logFile, `[${formattedDate}] [${fileLoggingMessage.type}] ${fileLoggingMessage.message}${os_1.EOL}`);
        }
    }
}
exports.FileLogService = FileLogService;
//# sourceMappingURL=file-log-service.js.map