package org.xbib.logging;

/**
 * Used to create a {@link LogContextConfigurator}. The {@linkplain #priority() priority} is used to determine which
 * factory should be used. The lowest priority factory is used. If two factories have the same priority the second
 * factory will not be used. The order of loading the factories for determining priority is done via the
 * {@link java.util.ServiceLoader#load(Class, ClassLoader)}.
 */
public interface LogContextConfiguratorFactory {

    /**
     * Creates the {@link LogContextConfigurator}.
     *
     * @return the log context configurator
     */
    LogContextConfigurator create();

    /**
     * The priority for the factory which is used to determine which factory should be used to create a
     * {@link LogContextConfigurator}. The lowest priority factory will be used.
     *
     * @return the priority for this factory
     */
    int priority();
}
