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

ru.yandex.qatools.allure.logging.LogManager Maven / Gradle / Ivy

There is a newer version: 1.5.4
Show newest version
package ru.yandex.qatools.allure.logging;

import ch.qos.cal10n.MessageConveyor;
import org.slf4j.cal10n.LocLogger;
import org.slf4j.cal10n.LocLoggerFactory;
import ru.qatools.properties.PropertyLoader;
import ru.yandex.qatools.allure.CommandProperties;

import java.util.Locale;

/**
 * @author Artem Eroshenko 
 */
public class LogManager {

    public static final String LOCALE_TAG = PropertyLoader.newInstance().
            populate(CommandProperties.class).getAllureLocale();

    private LogManager() {
    }

    public static Locale getLocale() {
        return Locale.forLanguageTag(LOCALE_TAG);
    }

    public static LocLogger getLogger(Class clazz) {
        return getLogger(clazz, getLocale());
    }

    public static LocLogger getLogger(Class clazz, Locale locale) {
        MessageConveyor conveyor = new MessageConveyor(locale);
        LocLoggerFactory factory = new LocLoggerFactory(conveyor);
        return factory.getLocLogger(clazz);
    }

    public static void shutdown() {
        org.apache.log4j.LogManager.shutdown();
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy