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 voidaudit(String message)voidaudit(String format, Object arg)voidaudit(String format, Object... arguments)voidaudit(String format, Object arg1, Object arg2)voiddebug(String message)voiddebug(String format, Object arg)voiddebug(String format, Object... arguments)voiddebug(String format, Object arg1, Object arg2)voiddebug(Supplier<String> messageSupplier)If debug level is enabled, get the message from the supplier and log it.voiddebug(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)voiderror(String message)voiderror(String format, Object arg)voiderror(String format, Object... arguments)voiderror(String format, Object arg1, Object arg2)voiderror(Supplier<String> messageSupplier)If error level is enabled, get the message from the supplier and log it.voiderror(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)voidinfo(String message)voidinfo(String format, Object arg)voidinfo(String format, Object... arguments)voidinfo(String format, Object arg1, Object arg2)voidinfo(Supplier<String> messageSupplier)If info level is enabled, get the message from the supplier and log it.voidinfo(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)booleanisDebugEnabled()booleanisErrorEnabled()booleanisInfoEnabled()booleanisTraceEnabled()booleanisWarnEnabled()voidloggerFactoryUpdated(LoggerFactory factory)Called when the logger factory changes.voidtrace(String message)voidtrace(String format, Object arg)voidtrace(String format, Object... arguments)voidtrace(String format, Object arg1, Object arg2)voidtrace(Supplier<String> messageSupplier)If trace level is enabled, get the message from the supplier and log it.voidtrace(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)voidwarn(String message)voidwarn(String format, Object arg)voidwarn(String format, Object... arguments)voidwarn(String format, Object arg1, Object arg2)voidwarn(Supplier<String> messageSupplier)If warn level is enabled, get the message from the supplier and log it.voidwarn(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:AbstractLoggerFacadeCalled when the logger factory changes. Derived classes must update the logger that they had previously obtained.- Specified by:
loggerFactoryUpdatedin interfaceLoggerFacade- Specified by:
loggerFactoryUpdatedin classAbstractLoggerFacade<Lf4OsgiLogger>- Parameters:
factory- the factory
-
isTraceEnabled
public boolean isTraceEnabled()
- Specified by:
isTraceEnabledin 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:LoggerIf 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:LoggerIf trace level is enabled, get the message from the supplier and log it together withe the provided throwable.
-
isDebugEnabled
public boolean isDebugEnabled()
- Specified by:
isDebugEnabledin 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:LoggerIf 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:LoggerIf debug level is enabled, get the message from the supplier and log it together withe the provided throwable.
-
isInfoEnabled
public boolean isInfoEnabled()
- Specified by:
isInfoEnabledin 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:LoggerIf 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:LoggerIf info level is enabled, get the message from the supplier and log it together withe the provided throwable.
-
isWarnEnabled
public boolean isWarnEnabled()
- Specified by:
isWarnEnabledin interfaceLogger
-
warn
public void warn(Supplier<String> messageSupplier)
Description copied from interface:LoggerIf 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:LoggerIf warn level is enabled, get the message from the supplier and log it together withe the provided throwable.
-
isErrorEnabled
public boolean isErrorEnabled()
- Specified by:
isErrorEnabledin 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:LoggerIf 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:LoggerIf error level is enabled, get the message from the supplier and log it together withe the provided throwable.
-
-