All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.polygonal.plugin.Logger Maven / Gradle / Ivy

There is a newer version: 3.0.3
Show newest version
package io.polygonal.plugin;

import org.apache.maven.plugin.logging.Log;

class Logger implements io.polygonal.Logger.LoggerMethods {
    private final Log log;

    Logger(Log log) {
        this.log = log;
    }

    @Override
    public void info(String msg, Object... args) {
        log.info(msg);
    }

    @Override
    public void error(String msg, Object... args) {
        if (args.length > 0 && args[0] instanceof Throwable) {
            log.error(msg, (Throwable) args[0]);
        } else {
            log.error(msg);
        }
    }

    @Override
    public void warn(String msg, Object... args) {
        if (args.length > 0 && args[0] instanceof Throwable) {
            log.warn(msg, (Throwable) args[0]);
        } else {
            log.warn(msg);
        }
    }

    @Override
    public void debug(String msg, Object... args) {
        if (args.length > 0 && args[0] instanceof Throwable) {
            log.debug(msg, (Throwable) args[0]);
        } else {
            log.debug(msg);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy