liquibase.logging.core.CompositeLogService Maven / Gradle / Ivy
package liquibase.logging.core;
import liquibase.Scope;
import liquibase.logging.LogService;
import liquibase.logging.Logger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class CompositeLogService extends AbstractLogService {
private List services = new ArrayList<>();
public CompositeLogService() {
}
public CompositeLogService(boolean includeCurrentScopeLogService, LogService... logService) {
this.services = new ArrayList<>(Arrays.asList(logService));
if (includeCurrentScopeLogService) {
services.add(Scope.getCurrentScope().get(Scope.Attr.logService, LogService.class));
}
}
@Override
public int getPriority() {
return PRIORITY_NOT_APPLICABLE;
}
@Override
public Logger getLog(Class clazz) {
List loggers = new ArrayList<>();
for (LogService service : services) {
loggers.add(service.getLog(clazz));
}
return new CompositeLogger(loggers);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy