"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NullLogHandlerData = exports.ConsoleLogHandlerData = exports.FileLogHandlerData = exports.LogHandlerData = void 0;
class LogHandlerData {
    constructor(verbose = false) {
        this._verbose = verbose;
    }
    get verbose() {
        return this._verbose;
    }
    set verbose(verbose) {
        this._verbose = verbose;
    }
    getIsVerbose() {
        return this._verbose;
    }
    setIsVerbose(verbose) {
        this.verbose = verbose;
    }
    log(message) {
        this.onMessage(message);
    }
    /** @internal */
    toJSON() {
        return {
            log: this.onMessage.bind(this),
            open: this.open.bind(this),
            close: this.close.bind(this),
        };
    }
}
exports.LogHandlerData = LogHandlerData;
class FileLogHandlerData extends LogHandlerData {
    constructor(verbose, filename = 'eyes.log', append = true) {
        super(verbose);
        this.type = 'file';
        this.filename = filename;
        this.append = append;
    }
    onMessage() {
        return undefined;
    }
    open() {
        return undefined;
    }
    close() {
        return undefined;
    }
    /** @internal */
    toJSON() {
        return { type: this.type, filename: this.filename, append: this.append };
    }
}
exports.FileLogHandlerData = FileLogHandlerData;
class ConsoleLogHandlerData extends LogHandlerData {
    constructor() {
        super(...arguments);
        this.type = 'console';
    }
    onMessage() {
        return undefined;
    }
    open() {
        return undefined;
    }
    close() {
        return undefined;
    }
    /** @internal */
    toJSON() {
        return { type: this.type };
    }
}
exports.ConsoleLogHandlerData = ConsoleLogHandlerData;
class NullLogHandlerData extends LogHandlerData {
    onMessage() {
        return undefined;
    }
    open() {
        return undefined;
    }
    close() {
        return undefined;
    }
    /** @internal */
    toJSON() {
        return null;
    }
}
exports.NullLogHandlerData = NullLogHandlerData;
