[openrtm-commit:00303] r519 - in branches/work/ForLogFormat/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC: . log
openrtm @ openrtm.org
openrtm @ openrtm.org
2011年 8月 3日 (水) 15:59:56 JST
Author: fsi-katami
Date: 2011-08-03 15:59:56 +0900 (Wed, 03 Aug 2011)
New Revision: 519
Modified:
branches/work/ForLogFormat/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java
branches/work/ForLogFormat/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java
Log:
Changed the format of the log. Added the millisecond. refs #1977
Modified: branches/work/ForLogFormat/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java
===================================================================
--- branches/work/ForLogFormat/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java 2011-08-03 06:19:52 UTC (rev 518)
+++ branches/work/ForLogFormat/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java 2011-08-03 06:59:56 UTC (rev 519)
@@ -28,7 +28,7 @@
"os.hostname", "",
"logger.enable", "YES",
"logger.file_name", "./rtc%p.log",
- "logger.date_format", "%b %d %H:%M:%S",
+ "logger.date_format", "%b %d %H:%M:%S.%Q",
"logger.log_level", "INFO",
"logger.stream_lock", "NO",
"logger.master_logger", "",
Modified: branches/work/ForLogFormat/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java
===================================================================
--- branches/work/ForLogFormat/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java 2011-08-03 06:19:52 UTC (rev 518)
+++ branches/work/ForLogFormat/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java 2011-08-03 06:59:56 UTC (rev 519)
@@ -394,13 +394,15 @@
*/
public void setDateFormat(final String format) {
m_dateFormat = format.replace("%","%t");
+ m_dateFormat = m_dateFormat.replace("tQ","tL");
+ m_dateFormat = m_dateFormat.replace("tq","tN");
try {
StringBuilder sb = new StringBuilder();
Date date = new Date();
java.util.Formatter formatter = new java.util.Formatter(sb, java.util.Locale.US);
- formatter.format(m_dateFormat,date,date,date,date,date,date,date,date,date,date);
+ formatter.format(m_dateFormat,date,date,date,date,date,date,date,date,date,date,date,date);
} catch(IllegalFormatException ex){
- m_dateFormat = "%tb %td %tH:%tM:%tS";
+ m_dateFormat = "%tb %td %tH:%tM:%tS.%tL";
this.println(Logbuf.ERROR, "The specified format is illegal.");
}
}
@@ -440,7 +442,7 @@
/**
* <p>ログに付加する日付形式の書式</p>
*/
- private String m_dateFormat = "%tb %td %tH:%tM:%tS";
+ private String m_dateFormat = "%tb %td %tH:%tM:%tS.%tL";
/**
* <p>日付の後に付加するヘッダ</p>
openrtm-commit メーリングリストの案内