java.lang.Object
provided.logger.impl.Logger
- All Implemented Interfaces:
ILogger
DEVELOPER CODE SHOULD NOT INSTANTIATE THIS CLASS DIRECTLY! USE ILoggerControl TO INSTANTIATE
A BASIC ILogger INSTANCE.
A basic utility ILogger implementation that should work in most scenarios.
- Author:
- swong
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LogLevel
The current minimum logging levelprivate Set<ILogEntryProcessor>
The current set of log entry processors to useprivate ILogger
The next logger in the chain.static Logger
The ILogger implementation to be shared on an application-wide level. -
Constructor Summary
ConstructorsConstructorDescriptionLogger()
Instantiate this logger with a single log entry processor = ILogEntryProcessor.DEFAULT and a minimum logging level of LogLevel.INFOLogger(ILogEntryProcessor logDisplayFn)
Instantiate this logger with the given log entry processor and a minimum logging level of LogLevel.INFOLogger(ILogEntryProcessor logDisplayFn, LogLevel logLevel)
Instantiate this logger with the given log entry processor and given minimum logging levelInstantiate this logger with a single log entry processor = ILogEntryProcessor.DEFAULT and a minimum logging level of LogLevel.INFO -
Method Summary
Modifier and TypeMethodDescriptionboolean
addLogProcessor(ILogEntryProcessor logProcFn)
Add the given log entry processor to the set of processors being used.Appends the chain represented by the given logger into this logger chain.boolean
TYPICAL DEVELOPER CODE NEVER CALLS THIS METHOD! Searches the this logger chain to find any occurrence of the given ILogger.void
TYPICAL DEVELOPER CODE NEVER CALLS THIS METHOD! Log the given log entry using a completed ILogEntry object where the code location is being explicitly specified.void
Log the given log entry where the code location is being automatically calculate.Remove the given logger from anywhere in the logger chain that begins with this logger.boolean
removeLogProcessor(ILogEntryProcessor logProcFn)
Remove the given log entry processor from the set of processors being used.void
setLogLevel(LogLevel logLevel)
Sets the minimum log level to be displayed.void
setLogProcessor(ILogEntryProcessor logProcFn)
Set the log entry processor being used.
-
Field Details
-
SHARED
The ILogger implementation to be shared on an application-wide level. -
nextLogger
The next logger in the chain. -
leProcessors
The current set of log entry processors to use -
currentLogLevel
The current minimum logging level
-
-
Constructor Details
-
Logger
public Logger()Instantiate this logger with a single log entry processor = ILogEntryProcessor.DEFAULT and a minimum logging level of LogLevel.INFO -
Logger
Instantiate this logger with a single log entry processor = ILogEntryProcessor.DEFAULT and a minimum logging level of LogLevel.INFO- Parameters:
level
- The minimum log level to use.
-
Logger
Instantiate this logger with the given log entry processor and a minimum logging level of LogLevel.INFO- Parameters:
logDisplayFn
- The log entry processor to use.
-
Logger
Instantiate this logger with the given log entry processor and given minimum logging level- Parameters:
logDisplayFn
- The log entry processor to use.logLevel
- The minimum logging level to process.
-
-
Method Details
-
log
Description copied from interface:ILogger
Log the given log entry where the code location is being automatically calculate. -
log
Description copied from interface:ILogger
TYPICAL DEVELOPER CODE NEVER CALLS THIS METHOD! Log the given log entry using a completed ILogEntry object where the code location is being explicitly specified. This method is used by ILoggers during a chained log. -
setLogProcessor
Description copied from interface:ILogger
Set the log entry processor being used. This processor will replace ALL processors currently in use.- Specified by:
setLogProcessor
in interfaceILogger
- Parameters:
logProcFn
- The new log processor function.
-
addLogProcessor
Description copied from interface:ILogger
Add the given log entry processor to the set of processors being used. Duplicate processors will not be added and will return a False value.- Specified by:
addLogProcessor
in interfaceILogger
- Parameters:
logProcFn
- The new log processor function to add.- Returns:
- true if the processor was successfully added, false if the processor was already in the current set of processors or could not be added.
-
removeLogProcessor
Description copied from interface:ILogger
Remove the given log entry processor from the set of processors being used. The last processor cannot be removed (returns false).- Specified by:
removeLogProcessor
in interfaceILogger
- Parameters:
logProcFn
- The new log processor function to remove.- Returns:
- true if the processor was found and removed, false otherwise.
-
setLogLevel
Description copied from interface:ILogger
Sets the minimum log level to be displayed.- Specified by:
setLogLevel
in interfaceILogger
- Parameters:
logLevel
- The minimum log level to be displayed.
-
append
Description copied from interface:ILogger
Appends the chain represented by the given logger into this logger chain. -
remove
Description copied from interface:ILogger
Remove the given logger from anywhere in the logger chain that begins with this logger. -
find
Description copied from interface:ILogger
TYPICAL DEVELOPER CODE NEVER CALLS THIS METHOD! Searches the this logger chain to find any occurrence of the given ILogger. This method is used between ILoggers to check for potential loops in chains.
-