public class LogUtils
extends java.lang.Object
| Constructor and Description |
|---|
LogUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
addBorder(java.lang.String[] segments)
Add border to string segments using default border formatter.
|
static void |
compress(java.lang.String folderPath,
java.lang.String zipFilePath)
Compress all files under the specific folder to a single zip file.
|
static java.lang.String |
formatJson(java.lang.String json)
Format a JSON string using default JSON formatter.
|
static java.lang.String |
formatStackTrace(java.lang.StackTraceElement[] stackTrace)
Format a stack trace using default stack trace formatter.
|
static java.lang.String |
formatThread(java.lang.Thread thread)
Format a thread using default thread formatter.
|
static java.lang.String |
formatThrowable(java.lang.Throwable throwable)
Format a throwable using default throwable formatter.
|
static java.lang.String |
formatXml(java.lang.String xml)
Format an XML string using default XML formatter.
|
public static java.lang.String formatJson(java.lang.String json)
json - the JSON string to formatpublic static java.lang.String formatXml(java.lang.String xml)
xml - the XML string to formatpublic static java.lang.String formatThrowable(java.lang.Throwable throwable)
throwable - the throwable to formatpublic static java.lang.String formatThread(java.lang.Thread thread)
thread - the thread to formatpublic static java.lang.String formatStackTrace(java.lang.StackTraceElement[] stackTrace)
stackTrace - the stack trace to formatpublic static java.lang.String addBorder(java.lang.String[] segments)
segments - the string segments to add border topublic static void compress(java.lang.String folderPath,
java.lang.String zipFilePath)
throws java.io.IOException
Should be call in background thread.
folderPath - the specific folder pathzipFilePath - the zip file pathjava.io.IOException - if any error occurs