Class Logger
- java.lang.Object
-
- com.github.markusbernhardt.proxy.util.Logger
-
public class Logger extends Object
Simple logging support for the framework. You need to add a logging listener that needs to send the logging events to a backend.- Author:
- Markus Bernhardt, Copyright 2016, Bernd Rosstauscher, Copyright 2009
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceLogger.LogBackEndInterface for a logging backend that can be attached to the logger.static classLogger.LogLevelstatic classLogger.Slf4jLogBackEndSlf4j logging backend.
-
Constructor Summary
Constructors Constructor Description Logger()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Logger.LogBackEndgetBackend()Gets the currently attached logging backend.static voidlog(Class<?> clazz, Logger.LogLevel loglevel, String msg, Object... params)Logs a message.static voidsetBackend(Logger.LogBackEnd backend)Attaches a new logging backend replacing the existing one.
-
-
-
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(Class<?> clazz, Logger.LogLevel loglevel, String msg, 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.
-
-