Class DefaultLogger
java.lang.Object
com.reposilite.journalist.backend.DefaultLogger
- All Implemented Interfaces:
Journalist,Logger
- Direct Known Subclasses:
AggregatedLogger,CachedLogger,InMemoryLogger,MultichannelCachedLogger,PrintStreamLogger,PublisherLogger
Abstract implementation of basic functionalities meant to be extended by a target implementation.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLog the given exception to the given channelGet stored loggerprotected abstract voidinternalLog(Channel channel, String message) Internal method used byDefaultLoggerto send processed message to the final implementation.Log the given message to the provided channelsetThreshold(Channel threshold) Modify current thresholdtoPrintStream(Channel channel) Create PrintStream that will write to the current logger.
-
Field Details
-
threshold
-
-
Constructor Details
-
DefaultLogger
-
-
Method Details
-
internalLog
Internal method used byDefaultLoggerto send processed message to the final implementation.- Parameters:
channel- the channel to log tomessage- the message to log
-
log
Description copied from interface:LoggerLog the given message to the provided channel -
exception
Description copied from interface:LoggerLog the given exception to the given channel -
setThreshold
Description copied from interface:LoggerModify current threshold- Specified by:
setThresholdin interfaceLogger- Parameters:
threshold- the threshold to set- Returns:
- the logger instance
-
toPrintStream
Description copied from interface:LoggerCreate PrintStream that will write to the current logger. Always remember about closing it after usage.- Specified by:
toPrintStreamin interfaceLogger- Returns:
- the associated print stream
-
getLogger
Description copied from interface:JournalistGet stored logger- Specified by:
getLoggerin interfaceJournalist- Returns:
- the associated logger
-