// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { getTracer } from "./lib.js";
import { LoggerLevel } from "./logger-level.js";
/**
 * The Logger class for the emitter.
 * @beta
 */
export class Logger {
    tracer;
    level;
    constructor(program, level) {
        this.tracer = getTracer(program);
        this.level = level;
    }
    trace(level, message) {
        switch (level) {
            case LoggerLevel.INFO:
                this.info(message);
                break;
            case LoggerLevel.DEBUG:
                this.debug(message);
                break;
            case LoggerLevel.VERBOSE:
                this.verbose(message);
                break;
        }
    }
    info(message) {
        if (this.level === LoggerLevel.INFO ||
            this.level === LoggerLevel.DEBUG ||
            this.level === LoggerLevel.VERBOSE) {
            this.tracer.trace(LoggerLevel.INFO, message);
        }
    }
    debug(message) {
        if (this.level === LoggerLevel.DEBUG || this.level === LoggerLevel.VERBOSE) {
            this.tracer.trace(LoggerLevel.DEBUG, message);
        }
    }
    verbose(message) {
        if (this.level === LoggerLevel.VERBOSE) {
            this.tracer.trace(LoggerLevel.VERBOSE, message);
        }
    }
    warn(message) {
        this.tracer.trace("warning", message);
    }
}
//# sourceMappingURL=logger.js.map