com.allen_sauer.gwt.log.client
Class LogUtil

java.lang.Object
  extended by com.allen_sauer.gwt.log.client.LogUtil

public class LogUtil
extends java.lang.Object


Constructor Summary
LogUtil()
           
 
Method Summary
static java.lang.String formatCategory(java.lang.String category, int precision)
          Helper method used by com.allen_sauer.gwt.log.rebind.LogMessageFormatterGenerator.
static java.lang.String formatDate(java.util.Date date, java.lang.String formatMask)
          Helper method used by com.allen_sauer.gwt.log.rebind.LogMessageFormatterGenerator
static java.lang.StackTraceElement getCallingStackTraceElement(java.lang.Throwable throwable)
           
static java.lang.String levelToString(int level)
           
static java.lang.String padLeft(java.lang.String text, int minLength)
           
static java.lang.String padRight(java.lang.String text, int minLength)
           
static java.lang.String stackTraceToString(java.lang.Throwable throwable)
           
static int stringToLevel(java.lang.String logLevelString)
           
static java.lang.String trim(java.lang.String text, int maxLength)
           
 
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

formatCategory

public static java.lang.String formatCategory(java.lang.String category,
                                              int precision)
Helper method used by com.allen_sauer.gwt.log.rebind.LogMessageFormatterGenerator. For example, the category com.example.foo.MyClass with precision 2 will result in foo.Myclass being returned.


formatDate

public static java.lang.String formatDate(java.util.Date date,
                                          java.lang.String formatMask)
Helper method used by com.allen_sauer.gwt.log.rebind.LogMessageFormatterGenerator


getCallingStackTraceElement

public static java.lang.StackTraceElement getCallingStackTraceElement(java.lang.Throwable throwable)
Parameters:
throwable - optional exception
Returns:
the calling stack trace element

levelToString

public static java.lang.String levelToString(int level)

padLeft

public static java.lang.String padLeft(java.lang.String text,
                                       int minLength)

padRight

public static java.lang.String padRight(java.lang.String text,
                                        int minLength)

stackTraceToString

public static java.lang.String stackTraceToString(java.lang.Throwable throwable)

stringToLevel

public static int stringToLevel(java.lang.String logLevelString)

trim

public static java.lang.String trim(java.lang.String text,
                                    int maxLength)