com.esf.core.logger.service
Interface IEsfLoggerService


public interface IEsfLoggerService

Event logging service to pass event messages at varying severity levels to system log. The IEsfLoggerService provides components instances of loggers as a factory service. This allows individual components to log at seperate levels simultaneously and also allows dynamic changes to the log levels at runtime. Copyright (c) 2009 Eurotech Inc. All rights reserved.


Field Summary
static int LOG_LEVEL_DEBUG
          Log level for debugging messages (but not lengthy dumps of information such as byte streams).
static int LOG_LEVEL_DUMP
          Log level for data dumps, such as list of hex bytes from serial streams, etc.
static int LOG_LEVEL_ERROR
          Log level for only errors (something didn't work as expected).
static int LOG_LEVEL_INFO
          Log level for informational messages about the status of the process.
static int LOG_LEVEL_NONE
          Set process to LOG_LEVEL_NONE if no event messages are desired to be sent to system log.
static int LOG_LEVEL_WARNING
          Log level for warning events (may or may not be a problem).
static java.lang.String SERVICE_NAME
          Reports the class name representing this interface.
 
Method Summary
 java.lang.String getLabel()
          Returns the label that is currently set to prepend to a log message
 int getLevel()
          Gets the logLevel for a process.
 int getLevel(java.lang.String symbolicName)
          this is a method to get the log level of any bundle that is using the log service by its bundle symbolic name.
 void logDebug(java.lang.String message)
          Generates a debug level logging message (LOG_LEVEL_DEBUG).
 void logDump(byte[] message)
          Generates a dump level logging message (LOG_LEVEL_DUMP).
 void logDump(java.lang.String message)
          Generates a dump level logging message (LOG_LEVEL_DUMP).
 void logError(java.lang.String message)
          Generates an error level logging message (LOG_LEVEL_ERROR).
 void logInfo(java.lang.String message)
          Generates a info level logging message (LOG_LEVEL_INFO).
 void logWarning(java.lang.String message)
          Generates a warning level logging message (LOG_LEVEL_WARNING).
 void setLabel(java.lang.String label)
          Adds a label that will be prepended to the log message.
 void setLevel(int logLevel)
          Sets the logLevel for a process.
 void setLevel(java.lang.String logLevel)
          Sets the logLevel for a process.
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
Reports the class name representing this interface.


LOG_LEVEL_NONE

static final int LOG_LEVEL_NONE
Set process to LOG_LEVEL_NONE if no event messages are desired to be sent to system log.

See Also:
Constant Field Values

LOG_LEVEL_ERROR

static final int LOG_LEVEL_ERROR
Log level for only errors (something didn't work as expected).

See Also:
Constant Field Values

LOG_LEVEL_WARNING

static final int LOG_LEVEL_WARNING
Log level for warning events (may or may not be a problem).

See Also:
Constant Field Values

LOG_LEVEL_INFO

static final int LOG_LEVEL_INFO
Log level for informational messages about the status of the process.

See Also:
Constant Field Values

LOG_LEVEL_DEBUG

static final int LOG_LEVEL_DEBUG
Log level for debugging messages (but not lengthy dumps of information such as byte streams).

See Also:
Constant Field Values

LOG_LEVEL_DUMP

static final int LOG_LEVEL_DUMP
Log level for data dumps, such as list of hex bytes from serial streams, etc.

See Also:
Constant Field Values
Method Detail

setLevel

void setLevel(int logLevel)
              throws java.lang.Exception
Sets the logLevel for a process.

Parameters:
logLevel - the logging level to use
Throws:
java.lang.Exception - if there is a problem setting the level

setLevel

void setLevel(java.lang.String logLevel)
              throws java.lang.Exception
Sets the logLevel for a process.

Parameters:
logLevel - the logging level to use, as @String, such as "@IEsfLoggerService.LOG_LEVEL_INFO".
Throws:
java.lang.Exception - if there is a problem setting the level

getLevel

int getLevel()
Gets the logLevel for a process.

Returns:
the logLevel to set, as an int

logError

void logError(java.lang.String message)
Generates an error level logging message (LOG_LEVEL_ERROR).

Parameters:
message - the message to be generated, as @String

logWarning

void logWarning(java.lang.String message)
Generates a warning level logging message (LOG_LEVEL_WARNING).

Parameters:
message - the message to be generated, as @String

logInfo

void logInfo(java.lang.String message)
Generates a info level logging message (LOG_LEVEL_INFO).

Parameters:
message - the message to be generated, as @String

logDebug

void logDebug(java.lang.String message)
Generates a debug level logging message (LOG_LEVEL_DEBUG).

Parameters:
message - the message to be generated, as @String

logDump

void logDump(java.lang.String message)
Generates a dump level logging message (LOG_LEVEL_DUMP).

Parameters:
message - the message to be generated, as @String

logDump

void logDump(byte[] message)
Generates a dump level logging message (LOG_LEVEL_DUMP).

Parameters:
message - the message to be generated, as a byte array

getLevel

int getLevel(java.lang.String symbolicName)
this is a method to get the log level of any bundle that is using the log service by its bundle symbolic name.

Parameters:
symbolicName - the symbolic name of the bundle to get the log level of
Returns:
an int representing the log level of the specified bundle

getLabel

java.lang.String getLabel()
Returns the label that is currently set to prepend to a log message

Returns:
a string representing the label

setLabel

void setLabel(java.lang.String label)
Adds a label that will be prepended to the log message.

Parameters:
label - a label to prepend to the message