|
Service Activator Toolkit
Version 1.0.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.soda.sat.core.util.LogUtility
The LogUtility class provides access to an instance of the OSGi
defined interface LogService that is guaranteed to never change
identity.
The class provides an implementation of the LogService whose
identity never changes. This implementation must wrap a target instance of
the LogService that can be changed. Operations on the
LogService provided by this class will be delegated to the
target LogService. The class also provides a way for the target
LogService to be changed.
This class is an anomaly and should never needs to be used under normal
circumstances. While coupling an application to the OSGi framework is
rarely a good design choice, arguably there are benefits to allowing an
application's business model to use the LogService. Therefore,
this utility class provides static access to an implementation of the
LogService.
This class also includes static methods as a convenient way of logging the
four categories of message as defined by the LogService, namely:
For example, the following methods are provided for logging errors:
In addition to the following convenience static method have been provided for
querying the current logging level:
The static method setLoggingLevel(int) may be used to set the
current logging level to one of the LogService values defined above.
Note: This is a singleton class, accessible only via the static method
getInstance(). For example:
LogUtility utility = LogUtility.getInstance();
LogService log = utility.getLog();
LogService| Method Summary | |
static LogUtility |
getInstance()
Public getter for the LogUtility singleton instance. |
LogService |
getLog()
Get the org.osgi.service.log.LogService. |
static int |
getLoggingLevel()
Get the current logging level. |
static boolean |
isLoggingDebug()
Query whether debug messages are being logged. |
static boolean |
isLoggingError()
Query whether error messages are being logged. |
static boolean |
isLoggingInfo()
Query whether info messages are being logged. |
static boolean |
isLoggingWarning()
Query whether debug messages are being logged. |
static void |
logDebug(Object id,
String message)
Log a LogService.LOG_DEBUG message. |
static void |
logDebug(Object id,
String message,
Throwable throwable)
Log a LogService.LOG_DEBUG level message. |
static void |
logDebug(String message)
Log a LogService.LOG_DEBUG message. |
static void |
logDebug(String message,
Throwable throwable)
Log a LogService.LOG_DEBUG level message. |
static void |
logError(Object id,
String message)
Log a LogService.LOG_ERROR message. |
static void |
logError(Object id,
String message,
Throwable throwable)
Log a LogService.LOG_ERROR level message. |
static void |
logError(String message)
Log a LogService.LOG_ERROR message. |
static void |
logError(String message,
Throwable throwable)
Log a LogService.LOG_ERROR level message. |
static void |
logInfo(Object id,
String message)
Log a LogService.LOG_INFO message. |
static void |
logInfo(Object id,
String message,
Throwable throwable)
Log a LogService.LOG_INFO level message. |
static void |
logInfo(String message)
Log a LogService.LOG_INFO message. |
static void |
logInfo(String message,
Throwable throwable)
Log a LogService.LOG_INFO level message. |
void |
logToFile(Object id,
String message)
Write the specified log message to the log file. |
static void |
logTrace(Object id,
String message)
Log a LogService.DEBUG_INFO level trace message. |
static void |
logTrace(Object id,
String message,
Throwable throwable)
Log a LogService.DEBUG_INFO level trace message. |
static void |
logTrace(String message)
Log a LogService.DEBUG_INFO level trace message. |
static void |
logTrace(String message,
Throwable throwable)
Log a LogService.DEBUG_INFO level trace message. |
static void |
logWarning(Object id,
String message)
Log a LogService.LOG_INFO message. |
static void |
logWarning(Object id,
String message,
Throwable throwable)
Log a LogService.LOG_WARNING level message. |
static void |
logWarning(String message)
Log a LogService.LOG_WARNING message. |
static void |
logWarning(String message,
Throwable throwable)
Log a LogService.LOG_WARNING level message. |
void |
setLog(LogService log)
Set the org.osgi.service.log.LogService. |
static void |
setLoggingLevel(int level)
Set the current logging level. |
void |
traceToFile(Object id,
String message)
Write the specified trace message to the log file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static LogUtility getInstance()
LogUtility singleton instance.
LogUtility singleton instance.public static int getLoggingLevel()
org.osgi.service.log.LogService
constants.public static boolean isLoggingDebug()
public static boolean isLoggingError()
public static boolean isLoggingInfo()
public static boolean isLoggingWarning()
public static void logDebug(Object id,
String message)
LogService.LOG_DEBUG message.
id - An object that uniquely identifies the source of the
message to logged.message - The message to log.
public static void logDebug(Object id,
String message,
Throwable throwable)
LogService.LOG_DEBUG level message.
id - An object that identifies who is logging the message.message - The message that will be logged.throwable - An accompanying Throwable.public static void logDebug(String message)
LogService.LOG_DEBUG message.
message - The message to log.
public static void logDebug(String message,
Throwable throwable)
LogService.LOG_DEBUG level message.
message - The message that will be logged.throwable - An accompanying Throwable.
public static void logError(Object id,
String message)
LogService.LOG_ERROR message.
id - An object that uniquely identifies the source of the
message to logged.message - The message to log.
public static void logError(Object id,
String message,
Throwable throwable)
LogService.LOG_ERROR level message.
id - An object that identifies who is logging the message.message - The message that will be logged.throwable - An accompanying Throwable.public static void logError(String message)
LogService.LOG_ERROR message.
message - The message to log.
public static void logError(String message,
Throwable throwable)
LogService.LOG_ERROR level message.
message - The message that will be logged.throwable - An accompanying Throwable.
public static void logInfo(Object id,
String message)
LogService.LOG_INFO message.
id - An object that uniquely identifies the source of the
message to logged.message - The message to log.
public static void logInfo(Object id,
String message,
Throwable throwable)
LogService.LOG_INFO level message.
id - An object that identifies who is logging the message.message - The message that will be logged.throwable - An accompanying Throwable.public static void logInfo(String message)
LogService.LOG_INFO message.
message - The message to log.
public static void logInfo(String message,
Throwable throwable)
LogService.LOG_INFO level message.
message - The message that will be logged.throwable - An accompanying Throwable.
public static void logTrace(Object id,
String message)
LogService.DEBUG_INFO level trace message.
id - An object that identifies who is logging the message.message - The message that will be logged.
public static void logTrace(Object id,
String message,
Throwable throwable)
LogService.DEBUG_INFO level trace message.
id - An object that identifies who is logging the message.message - The message that will be logged.throwable - An accompanying Throwable.public static void logTrace(String message)
LogService.DEBUG_INFO level trace message.
message - The message that will be logged.
public static void logTrace(String message,
Throwable throwable)
LogService.DEBUG_INFO level trace message.
message - The message that will be logged.throwable - An accompanying Throwable.
public static void logWarning(Object id,
String message)
LogService.LOG_INFO message.
id - An object that uniquely identifies the source of the
message to logged.message - The message to log.
public static void logWarning(Object id,
String message,
Throwable throwable)
LogService.LOG_WARNING level message.
id - An object that identifies who is logging the message.message - The message that will be logged.throwable - An accompanying Throwable.public static void logWarning(String message)
LogService.LOG_WARNING message.
message - The message to log.
public static void logWarning(String message,
Throwable throwable)
LogService.LOG_WARNING level message.
message - The message that will be logged.throwable - An accompanying Throwable.public static void setLoggingLevel(int level)
level - One of the org.osgi.service.log.LogService
constants.public LogService getLog()
org.osgi.service.log.LogService.
public void logToFile(Object id,
String message)
id - An object that identifies who is logging the message.message - The message to log.public void setLog(LogService log)
org.osgi.service.log.LogService.
log - A log service.
public void traceToFile(Object id,
String message)
id - An object that identifies who is logging the message.message - The message to log.
|
Service Activator Toolkit
Version 1.0.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2001, 2007 IBM Corporation and others. All Rights Reserved.