org.apache.felix.ipojo.util
Class Logger

java.lang.Object
  extended by org.apache.felix.ipojo.util.Logger

public class Logger
extends java.lang.Object

iPOJO Logger. This logger send log message to a log service if presents.

Author:
Felix Project Team

Field Summary
static int DEBUG
          Log Level DEBUG.
static int ERROR
          Log Level ERROR.
static int INFO
          Log Level INFO.
static java.lang.String IPOJO_LOG_LEVEL
          Ipojo default log level property.
static int WARNING
          Log Level WARNING.
 
Constructor Summary
Logger(org.osgi.framework.BundleContext context, java.lang.String name)
          Constructor.
Logger(org.osgi.framework.BundleContext context, java.lang.String name, int level)
          Constructor.
 
Method Summary
 void log(int level, java.lang.String msg)
          Log a message.
 void log(int level, java.lang.String msg, java.lang.Throwable exception)
          Log a message with an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IPOJO_LOG_LEVEL

public static final java.lang.String IPOJO_LOG_LEVEL
Ipojo default log level property.

See Also:
Constant Field Values

ERROR

public static final int ERROR
Log Level ERROR.

See Also:
Constant Field Values

WARNING

public static final int WARNING
Log Level WARNING.

See Also:
Constant Field Values

INFO

public static final int INFO
Log Level INFO.

See Also:
Constant Field Values

DEBUG

public static final int DEBUG
Log Level DEBUG.

See Also:
Constant Field Values
Constructor Detail

Logger

public Logger(org.osgi.framework.BundleContext context,
              java.lang.String name,
              int level)
Constructor.

Parameters:
context - : bundle context
name - : name of the logger
level - : trace level

Logger

public Logger(org.osgi.framework.BundleContext context,
              java.lang.String name)
Constructor.

Parameters:
context - : bundle context
name - : name of the logger
Method Detail

log

public void log(int level,
                java.lang.String msg)
Log a message.

Parameters:
level - : level of the message
msg - : the message to log

log

public void log(int level,
                java.lang.String msg,
                java.lang.Throwable exception)
Log a message with an exception.

Parameters:
level - : level of the message
msg - : message to log
exception - : exception attached to the message