Package org.apache.rat.utils
Class DefaultLog
java.lang.Object
org.apache.rat.utils.DefaultLog
- All Implemented Interfaces:
Log
A default implementation of Log that writes to
System.out and System.err.
The singleton instance is stored in a ThreadLocal so that each thread
(e.g. parallel Maven reactor threads) gets its own logger and does not
interfere with loggers set by other threads.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LogCreates a new instance of the default log.static LogRetrieves the DefaultLog instance for the current thread.getLevel()Gets the level we are writing at.voidWrites a message at a specific log level.static LogsetInstance(Log newInstance) Sets the default log instance for the current thread.voidSets the level.
-
Method Details
-
getInstance
Retrieves the DefaultLog instance for the current thread.- Returns:
- the Default log instance.
-
setInstance
Sets the default log instance for the current thread. If not set an instance of DefaultLog will be returned.- Parameters:
newInstance- a Log to use as the default.- Returns:
- the old instance.
-
createDefault
Creates a new instance of the default log.- Returns:
- A new instance of the default log.
-
setLevel
Sets the level. Log messages below the specified level will not be written to the log. -
getLevel
Gets the level we are writing at. -
log
Description copied from interface:LogWrites a message at a specific log level.
-