Package de.mnl.osgi.lf4osgi
Class Lf4OsgiLogger
- java.lang.Object
-
- de.mnl.osgi.lf4osgi.core.AbstractLoggerFacade<Lf4OsgiLogger>
-
- de.mnl.osgi.lf4osgi.Lf4OsgiLogger
-
- All Implemented Interfaces:
LoggerFacade
,Logger
,Logger
public class Lf4OsgiLogger extends AbstractLoggerFacade<Lf4OsgiLogger> implements Logger
-
-
Field Summary
-
Fields inherited from interface org.osgi.service.log.Logger
ROOT_LOGGER_NAME
-
-
Constructor Summary
Constructors Constructor Description Lf4OsgiLogger(LoggerGroup context, String name)
Instantiates a new logger for the given bundle with the provided name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
audit(String message)
void
audit(String format, Object arg)
void
audit(String format, Object... arguments)
void
audit(String format, Object arg1, Object arg2)
void
debug(String message)
void
debug(String format, Object arg)
void
debug(String format, Object... arguments)
void
debug(String format, Object arg1, Object arg2)
void
debug(Supplier<String> messageSupplier)
If debug level is enabled, get the message from the supplier and log it.void
debug(Supplier<String> messageSupplier, Throwable thr)
If debug level is enabled, get the message from the supplier and log it together withe the provided throwable.<E extends Exception>
voiddebug(LoggerConsumer<E> consumer)
void
error(String message)
void
error(String format, Object arg)
void
error(String format, Object... arguments)
void
error(String format, Object arg1, Object arg2)
void
error(Supplier<String> messageSupplier)
If error level is enabled, get the message from the supplier and log it.void
error(Supplier<String> messageSupplier, Throwable thr)
If error level is enabled, get the message from the supplier and log it together withe the provided throwable.<E extends Exception>
voiderror(LoggerConsumer<E> consumer)
void
info(String message)
void
info(String format, Object arg)
void
info(String format, Object... arguments)
void
info(String format, Object arg1, Object arg2)
void
info(Supplier<String> messageSupplier)
If info level is enabled, get the message from the supplier and log it.void
info(Supplier<String> messageSupplier, Throwable thr)
If info level is enabled, get the message from the supplier and log it together withe the provided throwable.<E extends Exception>
voidinfo(LoggerConsumer<E> consumer)
boolean
isDebugEnabled()
boolean
isErrorEnabled()
boolean
isInfoEnabled()
boolean
isTraceEnabled()
boolean
isWarnEnabled()
void
loggerFactoryUpdated(LoggerFactory factory)
Called when the logger factory changes.void
trace(String message)
void
trace(String format, Object arg)
void
trace(String format, Object... arguments)
void
trace(String format, Object arg1, Object arg2)
void
trace(Supplier<String> messageSupplier)
If trace level is enabled, get the message from the supplier and log it.void
trace(Supplier<String> messageSupplier, Throwable thr)
If trace level is enabled, get the message from the supplier and log it together withe the provided throwable.<E extends Exception>
voidtrace(LoggerConsumer<E> consumer)
void
warn(String message)
void
warn(String format, Object arg)
void
warn(String format, Object... arguments)
void
warn(String format, Object arg1, Object arg2)
void
warn(Supplier<String> messageSupplier)
If warn level is enabled, get the message from the supplier and log it.void
warn(Supplier<String> messageSupplier, Throwable thr)
If warn level is enabled, get the message from the supplier and log it together withe the provided throwable.<E extends Exception>
voidwarn(LoggerConsumer<E> consumer)
-
Methods inherited from class de.mnl.osgi.lf4osgi.core.AbstractLoggerFacade
getBundle, getName
-
-
-
-
Constructor Detail
-
Lf4OsgiLogger
public Lf4OsgiLogger(LoggerGroup context, String name)
Instantiates a new logger for the given bundle with the provided name.- Parameters:
context
- the contextname
- the name
-
-
Method Detail
-
loggerFactoryUpdated
public void loggerFactoryUpdated(LoggerFactory factory)
Description copied from class:AbstractLoggerFacade
Called when the logger factory changes. Derived classes must update the logger that they had previously obtained.- Specified by:
loggerFactoryUpdated
in interfaceLoggerFacade
- Specified by:
loggerFactoryUpdated
in classAbstractLoggerFacade<Lf4OsgiLogger>
- Parameters:
factory
- the factory
-
isTraceEnabled
public boolean isTraceEnabled()
- Specified by:
isTraceEnabled
in interfaceLogger
-
trace
public <E extends Exception> void trace(LoggerConsumer<E> consumer) throws E extends Exception
-
trace
public void trace(Supplier<String> messageSupplier)
Description copied from interface:Logger
If trace level is enabled, get the message from the supplier and log it.
-
trace
public void trace(Supplier<String> messageSupplier, Throwable thr)
Description copied from interface:Logger
If trace level is enabled, get the message from the supplier and log it together withe the provided throwable.
-
isDebugEnabled
public boolean isDebugEnabled()
- Specified by:
isDebugEnabled
in interfaceLogger
-
debug
public <E extends Exception> void debug(LoggerConsumer<E> consumer) throws E extends Exception
-
debug
public void debug(Supplier<String> messageSupplier)
Description copied from interface:Logger
If debug level is enabled, get the message from the supplier and log it.
-
debug
public void debug(Supplier<String> messageSupplier, Throwable thr)
Description copied from interface:Logger
If debug level is enabled, get the message from the supplier and log it together withe the provided throwable.
-
isInfoEnabled
public boolean isInfoEnabled()
- Specified by:
isInfoEnabled
in interfaceLogger
-
info
public <E extends Exception> void info(LoggerConsumer<E> consumer) throws E extends Exception
-
info
public void info(Supplier<String> messageSupplier)
Description copied from interface:Logger
If info level is enabled, get the message from the supplier and log it.
-
info
public void info(Supplier<String> messageSupplier, Throwable thr)
Description copied from interface:Logger
If info level is enabled, get the message from the supplier and log it together withe the provided throwable.
-
isWarnEnabled
public boolean isWarnEnabled()
- Specified by:
isWarnEnabled
in interfaceLogger
-
warn
public void warn(Supplier<String> messageSupplier)
Description copied from interface:Logger
If warn level is enabled, get the message from the supplier and log it.
-
warn
public <E extends Exception> void warn(LoggerConsumer<E> consumer) throws E extends Exception
-
warn
public void warn(Supplier<String> messageSupplier, Throwable thr)
Description copied from interface:Logger
If warn level is enabled, get the message from the supplier and log it together withe the provided throwable.
-
isErrorEnabled
public boolean isErrorEnabled()
- Specified by:
isErrorEnabled
in interfaceLogger
-
error
public <E extends Exception> void error(LoggerConsumer<E> consumer) throws E extends Exception
-
error
public void error(Supplier<String> messageSupplier)
Description copied from interface:Logger
If error level is enabled, get the message from the supplier and log it.
-
error
public void error(Supplier<String> messageSupplier, Throwable thr)
Description copied from interface:Logger
If error level is enabled, get the message from the supplier and log it together withe the provided throwable.
-
-