コミットメタ情報

リビジョン01d0a52a9a56029cfc18f57d58bdc19446bbafa0 (tree)
日時2013-04-28 11:39:48
作者argius <argius.net@gmai...>
コミッターargius

ログメッセージ

.

変更サマリ

  • delete: src/net/argius/logging/BasicFormatter.java

差分

--- a/src/net/argius/logging/BasicFormatter.java
+++ /dev/null
@@ -1,53 +0,0 @@
1-package net.argius.logging;
2-
3-import java.io.*;
4-import java.text.*;
5-import java.util.logging.*;
6-
7-/**
8- * LoggingFormatter.
9- */
10-public class BasicFormatter extends Formatter {
11-
12- @Override
13- public String format(LogRecord record) {
14- final String msg = record.getMessage();
15- final String formatted;
16- Object[] args = record.getParameters();
17- if (args != null && args.length > 0) {
18- formatted = MessageFormat.format(msg, args);
19- } else {
20- formatted = msg;
21- }
22- final String s;
23- final Throwable th = record.getThrown();
24- if (th != null) {
25- Writer w = new StringWriter();
26- PrintWriter out = new PrintWriter(w);
27- th.printStackTrace(out);
28- s = w.toString();
29- } else {
30- s = "";
31- }
32- final String datetime = String.format("%1$tF %1$tT.%1$tL", record.getMillis());
33- return String.format("%s %s %s#%s [%s] %s%n%s",
34- datetime,
35- Thread.currentThread().getName(),
36- record.getSourceClassName(),
37- record.getSourceMethodName(),
38- getLevelName(record.getLevel()),
39- formatted,
40- s);
41- }
42-
43- private static String getLevelName(Level lv) {
44- if (lv.equals(Level.FINE)) {
45- return "DEBUG";
46- }
47- if (lv.equals(Level.FINER)) {
48- return "TRACE";
49- }
50- return lv.toString();
51- }
52-
53-}
旧リポジトリブラウザで表示