本文整理汇总了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());
}