@@ -0,0 +1,2521 @@
+/*%0A * Copyright 2016 Elvis Hew%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.elvishew.xlog;%0A%0A/**%0A * Utilities for convenience.%0A */%0Apublic class LogUtils %7B%0A%0A    /**%0A     * Format a JSON string using default JSON formatter.%0A     *%0A     * @param json the JSON string to format%0A     * @return the formatted string%0A     */%0A    public static String formatJson(String json) %7B%0A        return XLog.sLogConfiguration.jsonFormatter.format(json);%0A    %7D%0A%0A    /**%0A     * Format an XML string using default XML formatter.%0A     *%0A     * @param xml the XML string to format%0A     * @return the formatted string%0A     */%0A    public static String formatXml(String xml) %7B%0A        return XLog.sLogConfiguration.xmlFormatter.format(xml);%0A    %7D%0A%0A    /**%0A     * Format a throwable using default throwable formatter.%0A     *%0A     * @param throwable the throwable to format%0A     * @return the formatted string%0A     */%0A    public static String formatThrowable(Throwable throwable) %7B%0A        return XLog.sLogConfiguration.throwableFormatter.format(throwable);%0A    %7D%0A%0A    /**%0A     * Format a thread using default thread formatter.%0A     *%0A     * @param thread the thread to format%0A     * @return the formatted string%0A     */%0A    public static String formatThread(Thread thread) %7B%0A        return XLog.sLogConfiguration.threadFormatter.format(thread);%0A    %7D%0A%0A    /**%0A     * Format a stack trace using default stack trace formatter.%0A     *%0A     * @param stackTrace the stack trace to format%0A     * @return the formatted string%0A     */%0A    public static String formatStackTrace(StackTraceElement%5B%5D stackTrace) %7B%0A        return XLog.sLogConfiguration.stackTraceFormatter.format(stackTrace);%0A    %7D%0A%0A    /**%0A     * Add border to string segments using default border formatter.%0A     *%0A     * @param segments the string segments to add border to%0A     * @return the bordered string segments%0A     */%0A    public static String addBorder(String%5B%5D segments) %7B%0A        return XLog.sLogConfiguration.borderFormatter.format(segments);%0A    %7D%0A%7D%0A

Add LogUtils for convenience