Package org.apache.uima.util.impl
Class Logger_impl
java.lang.Object
org.apache.uima.util.impl.Logger_impl
- All Implemented Interfaces:
Logger
UIMA Logging interface implementation without using an logging toolkit
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Level
message level to be loggedprivate static final Logger_impl
default logger instanceprivate static final PrintStream
default PrintStream to which the log messages are printed.private PrintStream
PrintStream which the object is used to log the messages, is by default set to defaultOutprivate ResourceManager
ResourceManager whose extension ClassLoader will be used to locate the message digests. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
creates a new Logger object and setSystem.out
as default output -
Method Summary
Modifier and TypeMethodDescriptionprivate ClassLoader
Gets the extension ClassLoader to used to locate the message digests.static Logger
creates a new Logger instance for the specified source classstatic Logger
getInstance
(Class<?> component) creates a new Logger instance for the specified source classboolean
isLoggable
(Level level) Checks if the argument level is greater or equal to the specified levelvoid
Deprecated.use method with log level as parametervoid
Deprecated.use method with log level as parametervoid
Generic logging method intended for logging wrappers.void
Logs a message.void
Logs a message with one parametervoid
Logs a message with an arbitrary number of parametersvoid
Logs a message and a throwable objectvoid
logException
(Exception aException) Deprecated.use method with log level as parameterprivate void
logException
(Level level, Throwable thrown) Logs an exception.private void
logMessage
(Level level, String aMessage) Logs a message.void
Logs a message with a message key.void
logrb
(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object param1) Logs a message with a message key and one parameter.void
logrb
(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object[] params) Logs a message with a message key and an arbitrary number of parameters.void
logrb
(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Throwable thrown) Logs a message with a message key and a throwable object.void
Sets the level of messages that will be logged by this logger.void
Deprecated.use external configuration possibilityvoid
Deprecated.use external configuration possibilityvoid
setResourceManager
(ResourceManager resourceManager) Sets the ResourceManager to use for message localization.
-
Field Details
-
defaultOut
default PrintStream to which the log messages are printed. Defaults toSystem.out
. -
mOut
PrintStream which the object is used to log the messages, is by default set to defaultOut -
configLevel
message level to be logged -
defaultLogger
default logger instance -
mResourceManager
ResourceManager whose extension ClassLoader will be used to locate the message digests. Null will cause the ClassLoader to default to this.class.getClassLoader().
-
-
Constructor Details
-
Logger_impl
private Logger_impl()creates a new Logger object and setSystem.out
as default output
-
-
Method Details
-
getInstance
creates a new Logger instance for the specified source class- Parameters:
component
- current source class- Returns:
- Logger - returns the Logger object for the specified class
-
getInstance
creates a new Logger instance for the specified source class- Returns:
- Logger - returns a new Logger object
-
log
Deprecated.use method with log level as parameterLogs a message with message level INFO -
log
Deprecated.use method with log level as parameterLogs a message with a message key and with the message level INFO -
logException
Deprecated.use method with log level as parameterLogs an exception with message level INFO- Specified by:
logException
in interfaceLogger
- Parameters:
aException
- the exception to be logged
-
setOutputStream
Deprecated.use external configuration possibilityDescription copied from interface:Logger
Sets the output stream to which log messages will go. Setting the output stream tonull
will disable the logger.- Specified by:
setOutputStream
in interfaceLogger
- Parameters:
out
-OutputStream
to which log messages will be printed- See Also:
-
setOutputStream
Deprecated.use external configuration possibilityDescription copied from interface:Logger
Sets the output stream to which log messages will go. Setting the output stream tonull
will disable the logger.- Specified by:
setOutputStream
in interfaceLogger
- Parameters:
out
-PrintStream
to which log messages will be printed- See Also:
-
logException
Logs an exception.- Parameters:
level
- message levelthrown
- the throwable
-
logMessage
Logs a message.- Parameters:
level
- message levelaMessage
- the message
-
isLoggable
Description copied from interface:Logger
Checks if the argument level is greater or equal to the specified level- Specified by:
isLoggable
in interfaceLogger
- Parameters:
level
- message level- Returns:
- boolean - true if the argument level is greater or equal to the specified level
-
log
Description copied from interface:Logger
Logs a message. -
log
Description copied from interface:Logger
Logs a message with one parameter -
log
Description copied from interface:Logger
Logs a message with an arbitrary number of parameters -
log
Description copied from interface:Logger
Logs a message and a throwable object -
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object param1) Description copied from interface:Logger
Logs a message with a message key and one parameter. The real message is extracted from a resource bundle. -
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object[] params) Description copied from interface:Logger
Logs a message with a message key and an arbitrary number of parameters. The real message is extracted from a resource bundle. -
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Throwable thrown) Description copied from interface:Logger
Logs a message with a message key and a throwable object. The real message is extracted from a resource bundle. -
logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey) Description copied from interface:Logger
Logs a message with a message key. The real message is extracted from a resource bundle. -
log
Description copied from interface:Logger
Generic logging method intended for logging wrappers. -
setLevel
Description copied from interface:Logger
Sets the level of messages that will be logged by this logger. Note that if you callUIMAFramework.getLogger().setLevel(level)
, this will only change the logging level for messages produced by the UIMA framework. It will NOT change the logging level for messages produced by annotators. To change the logging level for an annotator, useUIMAFramework.getLogger(YourAnnotatorClass.class).setLevel(level)
.If you need more flexibility it configuring the logger, consider using the standard Java logger properties file or the java.util.logging APIs.
-
setResourceManager
Description copied from interface:Logger
Sets the ResourceManager to use for message localization. This method is intended for use by the framework, not by user code.- Specified by:
setResourceManager
in interfaceLogger
- Parameters:
resourceManager
- A resource manager instance whose extension ClassLoader (if any) will be used for message localization by this logger.
-
getExtensionClassLoader
Gets the extension ClassLoader to used to locate the message digests. If this returns null, then message digests will be searched for using this.class.getClassLoader().
-