Class Logger
- java.lang.Object
-
- com.github.markusbernhardt.proxy.util.Logger
-
public class Logger extends java.lang.Object
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 Classes Modifier and Type Class Description static interface
Logger.LogBackEnd
Interface for a logging backend that can be attached to the logger.static class
Logger.LogLevel
class
Logger.Slf4jLogBackEnd
Slf4j logging backend.
-
Field Summary
Fields Modifier and Type Field Description private static Logger.LogBackEnd
backend
-
Constructor Summary
Constructors Constructor Description Logger()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Logger.LogBackEnd
getBackend()
Gets the currently attached logging backend.static void
log(java.lang.Class<?> clazz, Logger.LogLevel loglevel, java.lang.String msg, java.lang.Object... params)
Logs a message.static void
setBackend(Logger.LogBackEnd backend)
Attaches a new logging backend replacing the existing one.
-
-
-
Field Detail
-
backend
private static Logger.LogBackEnd backend
-
-
Method Detail
-
getBackend
public static Logger.LogBackEnd getBackend()
Gets the currently attached logging backend.- Returns:
- Returns the backend.
-
setBackend
public static void setBackend(Logger.LogBackEnd backend)
Attaches a new logging backend replacing the existing one.- Parameters:
backend
- The backend to set.
-
log
public static void log(java.lang.Class<?> clazz, Logger.LogLevel loglevel, java.lang.String msg, java.lang.Object... params)
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.
-
-