Knopflerfish OSGi 3.0.0

org.knopflerfish.service.log
Class LogUtil

java.lang.Object
  extended by org.knopflerfish.service.log.LogUtil

public class LogUtil
extends java.lang.Object

Utility class for the LogService interface. It exports methods that translates between the numeric values of the severity level constants and human readable strings.


Constructor Summary
LogUtil()
           
 
Method Summary
static java.lang.String fromLevel(int level)
          Converts from a numeric log severity level to a string.
static java.lang.String fromLevel(int level, int length)
          Converts from a numeric log severity level to a left justified string of at least the given length.
static int toLevel(java.lang.String level, int def)
          Converts a string representing a log severity level to an int.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogUtil

public LogUtil()
Method Detail

fromLevel

public static java.lang.String fromLevel(int level)
Converts from a numeric log severity level to a string.

Parameters:
level - is the log severity level.

fromLevel

public static java.lang.String fromLevel(int level,
                                         int length)
Converts from a numeric log severity level to a left justified string of at least the given length.

Parameters:
level - is the log severity level.
length - the minimum length of the resulting string.

toLevel

public static int toLevel(java.lang.String level,
                          int def)
Converts a string representing a log severity level to an int.

Parameters:
level - The string to convert.
def - Default value to use if the string is not recognized as a log level.
Returns:
the log level, or the default value if the string can not be recognized.

Knopflerfish OSGi 3.0.0