Coverity warns that the return of LogManager.getCurrentLoggers()
can contain null elements. Add an explicit null check to skip those.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
@SuppressWarnings("unchecked")
List<Logger> loggers = Collections.list(LogManager.getCurrentLoggers());
for (Logger logger : loggers) {
+ if (logger == null) {
+ continue;
+ }
+
/*
* Check if that logger has at least one LTTng log4j appender
* attached.