本文整理匯總了Java中com.esotericsoftware.minlog.Log.LEVEL_TRACE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Log.LEVEL_TRACE屬性的具體用法?Java Log.LEVEL_TRACE怎麽用?Java Log.LEVEL_TRACE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.esotericsoftware.minlog.Log
的用法示例。
在下文中一共展示了Log.LEVEL_TRACE屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: logMsg
private void logMsg(int level, String category, String message, Throwable ex) {
StringBuilder builder = new StringBuilder(256);
long time = new Date().getTime() - startUpTime;
long minutes = time / (1000 * 60);
long seconds = time / (1000) % 60;
if (minutes <= 9) builder.append('0');
builder.append(minutes);
builder.append(':');
if (seconds <= 9) builder.append('0');
builder.append(seconds);
switch (level) {
case Log.LEVEL_ERROR:
//builder.append(Util.ANSI_RED);
builder.append(" ERROR: ");
break;
case Log.LEVEL_WARN:
//builder.append(Util.ANSI_YELLOW);
builder.append(" WARN: ");
break;
case Log.LEVEL_INFO:
builder.append(" INFO: ");
break;
case Log.LEVEL_DEBUG:
//builder.append(Util.ANSI_GREEN);
builder.append(" DEBUG: ");
break;
case Log.LEVEL_TRACE:
builder.append(" TRACE: ");
break;
}
if (category != null) {
builder.append('[').append(category).append("] ");
}
builder.append(message);
if (ex != null) {
StringWriter writer = new StringWriter(256);
ex.printStackTrace(new PrintWriter(writer));
builder.append('\n');
builder.append(writer.toString().trim());
}
//builder.append(Util.ANSI_RESET);
print(builder.toString());
}