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 LogLevelThe current minimum logging levelprivate Set<ILogEntryProcessor>The current set of log entry processors to useprivate ILoggerThe next logger in the chain.static LoggerThe 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 TypeMethodDescriptionbooleanaddLogProcessor(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.booleanTYPICAL DEVELOPER CODE NEVER CALLS THIS METHOD! Searches the this logger chain to find any occurrence of the given ILogger.voidTYPICAL DEVELOPER CODE NEVER CALLS THIS METHOD! Log the given log entry using a completed ILogEntry object where the code location is being explicitly specified.voidLog 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.booleanremoveLogProcessor(ILogEntryProcessor logProcFn)Remove the given log entry processor from the set of processors being used.voidsetLogLevel(LogLevel logLevel)Sets the minimum log level to be displayed.voidsetLogProcessor(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:ILoggerLog the given log entry where the code location is being automatically calculate. -
log
Description copied from interface:ILoggerTYPICAL 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:ILoggerSet the log entry processor being used. This processor will replace ALL processors currently in use.- Specified by:
setLogProcessorin interfaceILogger- Parameters:
logProcFn- The new log processor function.
-
addLogProcessor
Description copied from interface:ILoggerAdd 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:
addLogProcessorin 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:ILoggerRemove the given log entry processor from the set of processors being used. The last processor cannot be removed (returns false).- Specified by:
removeLogProcessorin 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:ILoggerSets the minimum log level to be displayed.- Specified by:
setLogLevelin interfaceILogger- Parameters:
logLevel- The minimum log level to be displayed.
-
append
Description copied from interface:ILoggerAppends the chain represented by the given logger into this logger chain. -
remove
Description copied from interface:ILoggerRemove the given logger from anywhere in the logger chain that begins with this logger. -
find
Description copied from interface:ILoggerTYPICAL 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.
-