"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const graylog2_1 = require("graylog2");
const Transport = require("winston-transport");
class GraylogTransport extends Transport {
    constructor(options) {
        super(options);
        this.options = options;
        this.graylogClient = new graylog2_1.graylog(options.graylog);
    }
    log(info, callback) {
        setImmediate(() => {
            this.emit('logged', info);
        });
        this.graylogClient[info.level](info.message, info, this.options.staticMeta);
        callback();
    }
    close() {
        this.graylogClient.close();
    }
}
exports.default = GraylogTransport;
//# sourceMappingURL=GraylogTransport.js.map