|
OSGi™ Service Platform Release 4 Version 4.2 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LogService
Provides methods for bundles to write messages to the log.
LogService
methods are provided to log messages; optionally with a
ServiceReference
object or an exception.
Bundles must log messages in the OSGi environment with a severity level according to the following hierarchy:
Field Summary | |
---|---|
static int |
LOG_DEBUG
A debugging message (Value 4). |
static int |
LOG_ERROR
An error message (Value 1). |
static int |
LOG_INFO
An informational message (Value 3). |
static int |
LOG_WARNING
A warning message (Value 2). |
Method Summary | |
---|---|
void |
log(int level,
java.lang.String message)
Logs a message. |
void |
log(int level,
java.lang.String message,
java.lang.Throwable exception)
Logs a message with an exception. |
void |
log(ServiceReference sr,
int level,
java.lang.String message)
Logs a message associated with a specific ServiceReference
object. |
void |
log(ServiceReference sr,
int level,
java.lang.String message,
java.lang.Throwable exception)
Logs a message with an exception associated and a ServiceReference object. |
Field Detail |
---|
static final int LOG_ERROR
This log entry indicates the bundle or service may not be functional.
static final int LOG_WARNING
This log entry indicates a bundle or service is still functioning but may experience problems in the future because of the warning condition.
static final int LOG_INFO
This log entry may be the result of any change in the bundle or service and does not indicate a problem.
static final int LOG_DEBUG
This log entry is used for problem determination and may be irrelevant to anyone but the bundle developer.
Method Detail |
---|
void log(int level, java.lang.String message)
The ServiceReference
field and the Throwable
field
of the LogEntry
object will be set to null
.
level
- The severity of the message. This should be one of the
defined log levels but may be any integer that is interpreted in a
user defined way.message
- Human readable string describing the condition or
null
.LOG_ERROR
,
LOG_WARNING
,
LOG_INFO
,
LOG_DEBUG
void log(int level, java.lang.String message, java.lang.Throwable exception)
The ServiceReference
field of the LogEntry
object
will be set to null
.
level
- The severity of the message. This should be one of the
defined log levels but may be any integer that is interpreted in a
user defined way.message
- The human readable string describing the condition or
null
.exception
- The exception that reflects the condition or
null
.LOG_ERROR
,
LOG_WARNING
,
LOG_INFO
,
LOG_DEBUG
void log(ServiceReference sr, int level, java.lang.String message)
ServiceReference
object.
The Throwable
field of the LogEntry
will be set to
null
.
sr
- The ServiceReference
object of the service that this
message is associated with or null
.level
- The severity of the message. This should be one of the
defined log levels but may be any integer that is interpreted in a
user defined way.message
- Human readable string describing the condition or
null
.LOG_ERROR
,
LOG_WARNING
,
LOG_INFO
,
LOG_DEBUG
void log(ServiceReference sr, int level, java.lang.String message, java.lang.Throwable exception)
ServiceReference
object.
sr
- The ServiceReference
object of the service that this
message is associated with.level
- The severity of the message. This should be one of the
defined log levels but may be any integer that is interpreted in a
user defined way.message
- Human readable string describing the condition or
null
.exception
- The exception that reflects the condition or
null
.LOG_ERROR
,
LOG_WARNING
,
LOG_INFO
,
LOG_DEBUG
|
OSGi™ Service Platform Release 4 Version 4.2 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |