|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.ipojo.util.Logger
public class Logger
iPOJO Logger. This class is an helper class implementing a simple log system. This logger sends log messages to a log service if available.
| Field Summary | |
|---|---|
static int |
DEBUG
The Log Level DEBUG. |
static int |
ERROR
The Log Level ERROR. |
static int |
INFO
The Log Level INFO. |
static java.lang.String |
IPOJO_LOG_LEVEL_HEADER
iPOJO log level manifest header. |
static java.lang.String |
IPOJO_LOG_LEVEL_PROP
The iPOJO default log level property. |
private org.osgi.framework.BundleContext |
m_context
The Bundle Context used to get the log service. |
private int |
m_level
The trace level of this logger. |
private java.lang.String |
m_name
The name of the logger. |
static int |
WARNING
The Log Level WARNING. |
| Constructor Summary | |
|---|---|
Logger(org.osgi.framework.BundleContext context,
java.lang.String name)
Create a logger. |
|
Logger(org.osgi.framework.BundleContext context,
java.lang.String name,
int level)
Creates a logger. |
|
| Method Summary | |
|---|---|
private void |
dispatch(int level,
java.lang.String msg)
Internal log method. |
private void |
dispatch(int level,
java.lang.String msg,
java.lang.Throwable exception)
Internal log method. |
private static int |
getDefaultLevel(org.osgi.framework.BundleContext context)
Gets the default logger level. |
void |
log(int level,
java.lang.String msg)
Logs a message. |
void |
log(int level,
java.lang.String msg,
java.lang.Throwable exception)
Logs 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 |
|---|
public static final java.lang.String IPOJO_LOG_LEVEL_PROP
public static final java.lang.String IPOJO_LOG_LEVEL_HEADER
public static final int ERROR
public static final int WARNING
public static final int INFO
public static final int DEBUG
private org.osgi.framework.BundleContext m_context
private java.lang.String m_name
private int m_level
| Constructor Detail |
|---|
public Logger(org.osgi.framework.BundleContext context,
java.lang.String name,
int level)
context - the bundle contextname - the name of the loggerlevel - the trace level
public Logger(org.osgi.framework.BundleContext context,
java.lang.String name)
context - the bundle contextname - the name of the logger| Method Detail |
|---|
public void log(int level,
java.lang.String msg)
level - the level of the messagemsg - the the message to log
public void log(int level,
java.lang.String msg,
java.lang.Throwable exception)
level - the level of the messagemsg - the message to logexception - the exception attached to the message
private void dispatch(int level,
java.lang.String msg)
level - the level of the message.msg - the message to log
private void dispatch(int level,
java.lang.String msg,
java.lang.Throwable exception)
level - the level of the message.msg - the message to logexception - the exception attached to the messageprivate static int getDefaultLevel(org.osgi.framework.BundleContext context)
WARNING.
context - the bundle context.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||