org.eclipse.equinox.log.internal
Class ExtendedLogServiceImpl

java.lang.Object
  extended by org.eclipse.equinox.log.internal.ExtendedLogServiceImpl
All Implemented Interfaces:
ExtendedLogService, Logger, LogService

public class ExtendedLogServiceImpl
extends Object
implements ExtendedLogService, LogService


Field Summary
 
Fields inherited from interface org.osgi.service.log.LogService
LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING
 
Constructor Summary
ExtendedLogServiceImpl(ExtendedLogServiceFactory factory, Bundle bundle)
           
 
Method Summary
 Logger getLogger(Bundle logBundle, String name)
          Returns the logger associated with this logger name and bundle.
 Logger getLogger(String name)
          Returns the Logger object associated with this logger name for the bundle that retrieved this log service.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedLogServiceImpl

public ExtendedLogServiceImpl(ExtendedLogServiceFactory factory,
                              Bundle bundle)
Method Detail

log

public void log(int level,
                String message)
Description copied from interface: LogService
Logs a message.

The ServiceReference field and the Throwable field of the LogEntry object will be set to null.

Specified by:
log in interface Logger
Specified by:
log in interface LogService
Parameters:
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.
See Also:
LogService.LOG_ERROR, LogService.LOG_WARNING, LogService.LOG_INFO, LogService.LOG_DEBUG

log

public void log(int level,
                String message,
                Throwable exception)
Description copied from interface: LogService
Logs a message with an exception.

The ServiceReference field of the LogEntry object will be set to null.

Specified by:
log in interface Logger
Specified by:
log in interface LogService
Parameters:
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.
See Also:
LogService.LOG_ERROR, LogService.LOG_WARNING, LogService.LOG_INFO, LogService.LOG_DEBUG

log

public void log(ServiceReference sr,
                int level,
                String message)
Description copied from interface: LogService
Logs a message associated with a specific ServiceReference object.

The Throwable field of the LogEntry will be set to null.

Specified by:
log in interface Logger
Specified by:
log in interface LogService
Parameters:
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.
See Also:
LogService.LOG_ERROR, LogService.LOG_WARNING, LogService.LOG_INFO, LogService.LOG_DEBUG

log

public void log(ServiceReference sr,
                int level,
                String message,
                Throwable exception)
Description copied from interface: LogService
Logs a message with an exception associated and a ServiceReference object.

Specified by:
log in interface Logger
Specified by:
log in interface LogService
Parameters:
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.
See Also:
LogService.LOG_ERROR, LogService.LOG_WARNING, LogService.LOG_INFO, LogService.LOG_DEBUG

log

public void log(Object context,
                int level,
                String message)
Description copied from interface: Logger
Extends the LogService Logs a message with a context object

Specified by:
log in interface Logger
Parameters:
context - 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.
See Also:
LogService.log(int, String)

log

public void log(Object context,
                int level,
                String message,
                Throwable exception)
Description copied from interface: Logger
Logs a message with an exception associated and a context object.

Specified by:
log in interface Logger
Parameters:
context - 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 entry
See Also:
LogService.log(int, String, Throwable)

getLogger

public Logger getLogger(String name)
Description copied from interface: ExtendedLogService
Returns the Logger 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.

Specified by:
getLogger in interface ExtendedLogService
Parameters:
name - The logger name.
Returns:
Logger associated with the logger name.

getLogger

public Logger getLogger(Bundle logBundle,
                        String name)
Description copied from interface: ExtendedLogService
Returns the logger associated with this logger name and bundle.

Specified by:
getLogger in interface ExtendedLogService
Parameters:
logBundle - The bundles associated with this logger. If null the bundle that retrieved this log service is used.
name - The logger name.
Returns:
Logger associated with the logger name.

getName

public String getName()
Description copied from interface: Logger
Returns the name associated with this Logger object.

Specified by:
getName in interface Logger
Returns:
String containing the name associated with this Logger object;null if no name is associated.

isLoggable

public boolean isLoggable(int level)
Description copied from interface: Logger
Pre-checks if there are LogListeners who are listening for a matching log entry from this Logger.

Specified by:
isLoggable in interface Logger
Parameters:
level - The log level or severity of the message.
Returns:
boolean True if there a LogListener listening that can handle a log entry for this log level; false otherwise.
See Also:
ExtendedLogReaderService.addLogListener(org.osgi.service.log.LogListener, LogFilter), LogFilter


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.