Class TestLogManager
java.lang.Object
org.jlab.logging.TestLogManager
A simple class for testing a custom
LogManager, such as SplitLogManager.
How to set the logging level:
A .properties file is necessary, which has the class name and desired log level; for example,
org.jlab.logging.TestLogManager.level = FINEFrom high to low, the levels are:
SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST.
There are some example .properties files you can use with this class, like so:
java \ -Djava.util.logging.config.file=common-tools/clas-logging/src/main/resources/org/jlab/logging/TestLogManager.finest.properties \ -cp ... \ org.jlab.logging.TestLogManagerYou may write your own
.properties file, to control the logging level of all classes which use logging.- Author:
- dilks
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionconstructor: prints some messages tostdout, but not using the logger yet -
Method Summary
Modifier and TypeMethodDescriptionstatic voidrun the testsvoidtest1()test sending string literalsvoidtest2()test sending a format string with parametersvoidtest3()test exception handlingvoidtest4()test exception handlingvoidtest5()test lazy evaluation. the slow functionnap()will only run if the log level isFINEST.
-
Field Details
-
LOGGER
logger instance for this class
-
-
Constructor Details
-
TestLogManager
public TestLogManager()constructor: prints some messages tostdout, but not using the logger yet
-
-
Method Details
-
test1
public void test1()test sending string literals -
test2
public void test2()test sending a format string with parameters -
test3
public void test3()test exception handling -
test4
public void test4()test exception handling -
test5
public void test5()test lazy evaluation. the slow functionnap()will only run if the log level isFINEST. -
main
-