"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Logger = void 0;
class Logger {
    constructor(traceId, flows, sender) {
        this.traceId = traceId;
        this.flows = flows;
        this.sender = sender;
    }
    _log(level, message, args) {
        const logEntry = {
            ...(args || {}),
            level,
            time: Date.now(),
            traceId: this.traceId,
            flows: this.flows,
            msg: message,
        };
        this.sender.sendNoWait('log', logEntry);
    }
    info(message, args) {
        this._log('info', message, args);
    }
    error(message, args) {
        this._log('error', message, args);
    }
    debug(message, args) {
        this._log('debug', message, args);
    }
    warn(message, args) {
        this._log('warn', message, args);
    }
}
exports.Logger = Logger;
