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

liquibase.integration.ant.logging.AntTaskLogFactory Maven / Gradle / Ivy

There is a newer version: 3.6.2.5.inovus
Show newest version
package liquibase.integration.ant.logging;

import liquibase.logging.Logger;
import liquibase.logging.LoggerContext;
import liquibase.logging.LoggerFactory;
import liquibase.logging.core.NoOpLoggerContext;
import org.apache.tools.ant.Task;

/**
 * An implementation of the Liquibase LogService that logs all messages to the given Ant task. This should only be used
 * inside of Ant tasks.
 */
public final class AntTaskLogFactory implements LoggerFactory {

    private AntTaskLogger logger;

    public AntTaskLogFactory(Task task) {
        logger = new AntTaskLogger(task);
    }

    @Override
    public Logger getLog(Class clazz) {
        return logger;
    }

    @Override
    public LoggerContext pushContext(String key, Object object) {
        return new NoOpLoggerContext();
    }

    @Override
    public void close() {

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy