public class ExtendedLogServiceImpl extends Object implements ExtendedLogService, LogService
LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING| Constructor and Description |
|---|
ExtendedLogServiceImpl(ExtendedLogServiceFactory factory,
Bundle bundle) |
| Modifier and Type | Method and Description |
|---|---|
Logger |
getLogger(Bundle logBundle,
String name)
Returns the logger associated with this logger name and bundle.
|
Logger |
getLogger(String name)
Returns the
Logger |
String |
getName()
Returns the name associated with this
Logger
object. |
boolean |
isLoggable(int level)
Pre-checks if there are LogListeners who are listening for a matching log entry from this
Logger. |
void |
log(int level,
String message)
Logs a message.
|
void |
log(int level,
String message,
Throwable exception)
Logs a message with an exception.
|
void |
log(Object context,
int level,
String message)
Extends the
LogService
Logs a message with a context object |
void |
log(Object context,
int level,
String message,
Throwable exception)
Logs a message with an exception associated and a
context object.
|
void |
log(ServiceReference sr,
int level,
String message)
Logs a message associated with a specific
ServiceReference
object. |
void |
log(ServiceReference sr,
int level,
String message,
Throwable exception)
Logs a message with an exception associated and a
ServiceReference object. |
public ExtendedLogServiceImpl(ExtendedLogServiceFactory factory, Bundle bundle)
public void log(int level,
String message)
LogService
The ServiceReference field and the Throwable field
of the LogEntry object will be set to null.
log in interface Loggerlog in interface LogServicelevel - 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.LogService.LOG_ERROR,
LogService.LOG_WARNING,
LogService.LOG_INFO,
LogService.LOG_DEBUGpublic void log(int level,
String message,
Throwable exception)
LogService
The ServiceReference field of the LogEntry object
will be set to null.
log in interface Loggerlog in interface LogServicelevel - 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.LogService.LOG_ERROR,
LogService.LOG_WARNING,
LogService.LOG_INFO,
LogService.LOG_DEBUGpublic void log(ServiceReference sr, int level, String message)
LogServiceServiceReference
object.
The Throwable field of the LogEntry will be set to
null.
log in interface Loggerlog in interface LogServicesr - 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.LogService.LOG_ERROR,
LogService.LOG_WARNING,
LogService.LOG_INFO,
LogService.LOG_DEBUGpublic void log(ServiceReference sr, int level, String message, Throwable exception)
LogServiceServiceReference object.log in interface Loggerlog in interface LogServicesr - 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.LogService.LOG_ERROR,
LogService.LOG_WARNING,
LogService.LOG_INFO,
LogService.LOG_DEBUGpublic void log(Object context, int level, String message)
LoggerLogService
Logs a message with a context objectlog in interface Loggercontext - The context object this message is associated with.level - The log level or severity of the message.message - A human readable string to associate with log entry.LogService.log(int, String)public void log(Object context, int level, String message, Throwable exception)
Loggerlog in interface Loggercontext - The context object this message is associated with.level - The log level or severity of the message.message - A human readable string to associate with log entry.exception - The exception associated with this entryLogService.log(int, String, Throwable)public Logger getLogger(String name)
ExtendedLogServiceLogger object associated with this logger name for the bundle that retrieved this log service.
If loggerName is null the default Logger for this bundle is returned.getLogger in interface ExtendedLogServicename - The logger name.Logger associated with the logger name.public Logger getLogger(Bundle logBundle, String name)
ExtendedLogServicegetLogger in interface ExtendedLogServicelogBundle - The bundles associated with this logger. If null the bundle that retrieved this log service is used.name - The logger name.Logger associated with the logger name.public String getName()
LoggerLogger
object.public boolean isLoggable(int level)
LoggerLogger.isLoggable in interface Loggerlevel - The log level or severity of the message.boolean True if there a LogListener listening that can handle a log entry for this log level; false otherwise.ExtendedLogReaderService.addLogListener(org.osgi.service.log.LogListener, LogFilter),
LogFilterCopyright © 2007–2016 The Apache Software Foundation. All rights reserved.