org.apache.felix.upnp.basedriver.tool
Class Logger

java.lang.Object
  extended by org.apache.felix.upnp.basedriver.tool.Logger
All Implemented Interfaces:
java.util.EventListener, org.osgi.framework.ServiceListener

public class Logger
extends java.lang.Object
implements org.osgi.framework.ServiceListener


Field Summary
static java.lang.String END_ROW
           
static java.lang.String NEWLINE
           
static java.lang.String ROW
           
 
Constructor Summary
Logger(java.lang.String levelStr)
          Create a Logger with System.out as PrintStream and without reporting message on both PrintStream and LogService
 
Method Summary
 void close()
          Stop using the LogService and listening for those service event NOTE: All the message will be reported to PrintStream
 void DEBUG(java.lang.String message)
           
 void ERROR(java.lang.String message)
           
 boolean getCyberDebug()
           
 int getLogLevel()
           
 void INFO(java.lang.String message)
           
 void log(int msglevel, java.lang.String message)
          Logs a message.
 void log(int msglevel, java.lang.String message, java.lang.Throwable exception)
          Logs a message with an exception.
 void PACKET(java.lang.String message)
           
 void serviceChanged(org.osgi.framework.ServiceEvent e)
          Used to keep track the existence of a LogService
 void setCyberDebug(boolean value)
           
 void setCyberDebug(java.lang.String value)
           
 void setLogLevel(int level)
           
 void WARNING(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEWLINE

public static final java.lang.String NEWLINE

ROW

public static final java.lang.String ROW
See Also:
Constant Field Values

END_ROW

public static final java.lang.String END_ROW
See Also:
Constant Field Values
Constructor Detail

Logger

public Logger(java.lang.String levelStr)
Create a Logger with System.out as PrintStream and without reporting message on both PrintStream and LogService

Parameters:
log - ServiceReference to the LogService to use, or null to avoid the use of this service
See Also:
#Logger(LogService, PrintStream, boolean)
Method Detail

setCyberDebug

public void setCyberDebug(java.lang.String value)

setLogLevel

public void setLogLevel(int level)

getLogLevel

public int getLogLevel()

setCyberDebug

public void setCyberDebug(boolean value)

getCyberDebug

public boolean getCyberDebug()

ERROR

public final void ERROR(java.lang.String message)

WARNING

public final void WARNING(java.lang.String message)

INFO

public final void INFO(java.lang.String message)

DEBUG

public final void DEBUG(java.lang.String message)

PACKET

public final void PACKET(java.lang.String message)

log

public void log(int msglevel,
                java.lang.String message)
Logs a message.

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

Parameters:
msglevel - 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:
#LOG_ERROR, #LOG_WARNING, #LOG_INFO, #LOG_DEBUG

log

public void log(int msglevel,
                java.lang.String message,
                java.lang.Throwable exception)
Logs a message with an exception.

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

Parameters:
msglevel - 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:
#LOG_ERROR, #LOG_WARNING, #LOG_INFO, #LOG_DEBUG

serviceChanged

public void serviceChanged(org.osgi.framework.ServiceEvent e)
Used to keep track the existence of a LogService

Specified by:
serviceChanged in interface org.osgi.framework.ServiceListener
See Also:
ServiceListener.serviceChanged(org.osgi.framework.ServiceEvent)

close

public void close()
Stop using the LogService and listening for those service event NOTE: All the message will be reported to PrintStream