Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Rename Onap A1 client"
[nonrtric.git]
/
policy-agent
/
src
/
test
/
java
/
org
/
oransc
/
policyagent
/
utils
/
LoggingUtils.java
diff --git
a/policy-agent/src/test/java/org/oransc/policyagent/utils/LoggingUtils.java
b/policy-agent/src/test/java/org/oransc/policyagent/utils/LoggingUtils.java
index
a822bb3
..
a594091
100644
(file)
--- a/
policy-agent/src/test/java/org/oransc/policyagent/utils/LoggingUtils.java
+++ b/
policy-agent/src/test/java/org/oransc/policyagent/utils/LoggingUtils.java
@@
-30,23
+30,27
@@
import org.slf4j.LoggerFactory;
public class LoggingUtils {
/**
public class LoggingUtils {
/**
- * Returns a ListAppender that contains all logging events. Call this method at the very beginning of the test
+ * Returns a ListAppender that contains all logging events. Call this method right before calling the tested
+ * method.
+ *
+ * @return the log list appender for the given class.
*/
public static ListAppender<ILoggingEvent> getLogListAppender(Class<?> logClass) {
*/
public static ListAppender<ILoggingEvent> getLogListAppender(Class<?> logClass) {
- return getLogListAppender(logClass,
false
);
+ return getLogListAppender(logClass,
Level.ALL
);
}
/**
}
/**
- * Returns a ListAppender that contains all logging events. Call this method at the very beginning of the test
+ * Returns a ListAppender that contains events for the given level. Call this method right before calling the tested
+ * method.
*
* @param logClass class whose appender is wanted.
*
* @param logClass class whose appender is wanted.
- * @param allLevels true if all log levels should be activated.
+ * @param level the log level to log at.
+ *
+ * @return the log list appender for the given class logging on the given level.
*/
*/
- public static ListAppender<ILoggingEvent> getLogListAppender(Class<?> logClass,
boolean allLevels
) {
+ public static ListAppender<ILoggingEvent> getLogListAppender(Class<?> logClass,
Level level
) {
Logger logger = (Logger) LoggerFactory.getLogger(logClass);
Logger logger = (Logger) LoggerFactory.getLogger(logClass);
- if (allLevels) {
- logger.setLevel(Level.ALL);
- }
+ logger.setLevel(level);
ListAppender<ILoggingEvent> listAppender = new ListAppender<>();
listAppender.start();
logger.addAppender(listAppender);
ListAppender<ILoggingEvent> listAppender = new ListAppender<>();
listAppender.start();
logger.addAppender(listAppender);