Class Logger
- java.lang.Object
-
- org.eclipse.remote.telnet.internal.core.Logger
-
- All Implemented Interfaces:
java.util.EventListener,org.eclipse.osgi.service.debug.DebugOptionsListener
public final class Logger extends java.lang.Object implements org.eclipse.osgi.service.debug.DebugOptionsListenerA simple logger class. Every method in this class is static, so they can be called from both class and instance methods. To use this class, write code like this:Logger.log("something has happened"); Logger.log("counter is " + counter);
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTRACE_DEBUG_LOGstatic java.lang.StringTRACE_DEBUG_LOG_CHARstatic java.lang.StringTRACE_DEBUG_LOG_VT100BACKEND
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidconfigure(org.osgi.framework.BundleContext context)static java.lang.Stringencode(java.lang.String message)Encodes a String such that non-printable control characters are converted into user-readable escape sequences for logging.static booleanisLogEnabled()Checks if logging is enabled.booleanisOptionEnabled(java.lang.String option)static voidlog(java.lang.String message)Logs the specified message.static voidlogException(java.lang.Exception ex)Writes a stack trace for an exception to both Standard Error and to the log file.voidoptionsChanged(org.eclipse.osgi.service.debug.DebugOptions options)
-
-
-
Field Detail
-
TRACE_DEBUG_LOG
public static final java.lang.String TRACE_DEBUG_LOG
- See Also:
- Constant Field Values
-
TRACE_DEBUG_LOG_CHAR
public static final java.lang.String TRACE_DEBUG_LOG_CHAR
- See Also:
- Constant Field Values
-
TRACE_DEBUG_LOG_VT100BACKEND
public static final java.lang.String TRACE_DEBUG_LOG_VT100BACKEND
- See Also:
- Constant Field Values
-
-
Method Detail
-
configure
public static void configure(org.osgi.framework.BundleContext context)
-
encode
public static final java.lang.String encode(java.lang.String message)
Encodes a String such that non-printable control characters are converted into user-readable escape sequences for logging.- Parameters:
message- String to encode- Returns:
- encoded String
-
isLogEnabled
public static final boolean isLogEnabled()
Checks if logging is enabled.- Returns:
- true if logging is enabled.
-
log
public static final void log(java.lang.String message)
Logs the specified message. Do not append a newline to parameter message. This method does that for you.- Parameters:
message- A String containing the message to log.
-
logException
public static final void logException(java.lang.Exception ex)
Writes a stack trace for an exception to both Standard Error and to the log file.
-
optionsChanged
public void optionsChanged(org.eclipse.osgi.service.debug.DebugOptions options)
- Specified by:
optionsChangedin interfaceorg.eclipse.osgi.service.debug.DebugOptionsListener
-
isOptionEnabled
public boolean isOptionEnabled(java.lang.String option)
-
-