Interface FormatterLogger
-
- All Superinterfaces:
Logger
@ProviderType public interface FormatterLogger extends Logger
Provides methods for bundles to write messages to the log using printf-style format strings.Messages can be formatted by the Logger once the Logger determines the log level is enabled. Uses printf-style format strings as described in
Formatter
.You can also add a
Throwable
and/orServiceReference
to the generatedLogEntry
by passing them to the logging methods as additional arguments. If the last argument is aThrowable
orServiceReference
, it is added to the generatedLogEntry
and then if the next to last argument is aServiceReference
orThrowable
and not the same type as the last argument, it is also added to the generatedLogEntry
. These arguments will not be used as message arguments. For example:logger.info("Found service %s.", serviceReference, serviceReference); logger.warn("Something named %s happened.", name, serviceReference, throwable); logger.error("Failed.", exception);
If an exception occurs formatting the message, the logged message will indicate the formatting failure including the format string and the arguments.
- Since:
- 1.4
-
-
Field Summary
-
Fields inherited from interface org.osgi.service.log.Logger
ROOT_LOGGER_NAME
-
-
Method Summary
-
Methods inherited from interface org.osgi.service.log.Logger
audit, audit, audit, audit, debug, debug, debug, debug, debug, error, error, error, error, error, getName, info, info, info, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn
-
-