Class Logger
java.lang.Object
com.github.markusbernhardt.proxy.util.Logger
Simple logging support for the framework. You need to add a logging listener
that needs to send the logging events to a backend.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface for a logging backend that can be attached to the logger.static enum
class
Slf4j logging backend. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Logger.LogBackEnd
Gets the currently attached logging backend.static void
log
(Class<?> clazz, Logger.LogLevel loglevel, String msg, Object... params) Logs a message.static void
setBackend
(Logger.LogBackEnd backend) Attaches a new logging backend replacing the existing one.
-
Field Details
-
backend
-
-
Constructor Details
-
Logger
public Logger()
-
-
Method Details
-
getBackend
Gets the currently attached logging backend.- Returns:
- Returns the backend.
-
setBackend
Attaches a new logging backend replacing the existing one.- Parameters:
backend
- The backend to set.
-
log
Logs a message.- Parameters:
clazz
- the class that sends the log message.loglevel
- the logging level.msg
- the message format string.params
- the message parameters for the format string.
-