[Ttssh2-commit] [3418] ログにタイムスタンプを書き込むときにミリ秒も記録するようにした。

svnno****@sourc***** svnno****@sourc*****
2009年 5月 24日 (日) 00:09:38 JST


Revision: 3418
          http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3418
Author:   maya
Date:     2009-05-24 00:09:38 +0900 (Sun, 24 May 2009)

Log Message:
-----------
ログにタイムスタンプを書き込むときにミリ秒も記録するようにした。

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/teraterm/teraterm/filesys.cpp


-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2009-05-20 14:58:24 UTC (rev 3417)
+++ trunk/doc/en/html/about/history.html	2009-05-23 15:09:38 UTC (rev 3418)
@@ -56,6 +56,7 @@
         </ul></li>
       <li>added support for the position moving, the minimization, the maximization, the most front, the most back and the refresh control sequences regarding the dtterm window operation.</li>
       <li>Changed the BroadcastCommand functional specification. When the BroadcastCommand is not the realtime mode, a user cand send a message at the selected window in the listbox.</li>
+      <!--li>ƒƒO‚Ƀ^ƒCƒ€ƒXƒ^ƒ“ƒv‚ð‘‚«ž‚Þ‚Æ‚«‚Ƀ~ƒŠ•b‚à‹L˜^‚·‚é‚悤‚É‚µ‚½B</li-->
       <!--li>ŠØ‘Œêƒ‚[ƒh‚Ì’²®
         <ul>
           <li><a href="../menu/setup-general.html">Œ¾Œêƒ‚[ƒh</a>‚ðŽw’è‚·‚é <a href="../commandline/teraterm.html#la">/LA</a> ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“ƒIƒvƒVƒ‡ƒ“‚ŁAŠØ‘Œêƒ‚[ƒh‚ðŽw’è‚Å‚«‚é‚悤‚É‚µ‚½B</li>

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2009-05-20 14:58:24 UTC (rev 3417)
+++ trunk/doc/ja/html/about/history.html	2009-05-23 15:09:38 UTC (rev 3418)
@@ -56,6 +56,7 @@
         </ul></li>
       <li>dtterm‚̃EƒBƒ“ƒhƒE‘€ì§ŒäƒV[ƒPƒ“ƒX‚Ì“àAˆÊ’uˆÚ“®, Å¬‰», Å‘剻, Å‘O–Ê, Å”w–Ê, ƒŠƒtƒŒƒbƒVƒ…‚ɑΉž‚µ‚½B</li>
       <li>BroadcastCommandi”ñRealtime modej‚É‚¨‚¢‚āAƒŠƒXƒgƒ{ƒbƒNƒX‚Å‘I‘ð‚³‚ê‚½’[––‚ɑ΂µ‚Ă̂݁AƒƒbƒZ[ƒW‚𑗐M‚·‚é‚悤‚É‚µ‚½B</li>
+      <li>ƒƒO‚Ƀ^ƒCƒ€ƒXƒ^ƒ“ƒv‚ð‘‚«ž‚Þ‚Æ‚«‚Ƀ~ƒŠ•b‚à‹L˜^‚·‚é‚悤‚É‚µ‚½B</li>
       <li>ŠØ‘Œêƒ‚[ƒh‚Ì’²®
         <ul>
           <li><a href="../menu/setup-general.html">Œ¾Œêƒ‚[ƒh</a>‚ðŽw’è‚·‚é <a href="../commandline/teraterm.html#la">/LA</a> ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“ƒIƒvƒVƒ‡ƒ“‚ŁAŠØ‘Œêƒ‚[ƒh‚ðŽw’è‚Å‚«‚é‚悤‚É‚µ‚½B</li>

Modified: trunk/teraterm/teraterm/filesys.cpp
===================================================================
--- trunk/teraterm/teraterm/filesys.cpp	2009-05-20 14:58:24 UTC (rev 3417)
+++ trunk/teraterm/teraterm/filesys.cpp	2009-05-23 15:09:38 UTC (rev 3418)
@@ -640,6 +640,7 @@
 			// “ú•tƒtƒH[ƒ}ƒbƒg‚ð“ú–{‚Å‚Í‚È‚­¢ŠE•W€‚ɕύX‚µ‚½ (2006.7.23 yutaka)
 			/* 2007.05.24 Gentaro */
 			if ( ts.LogTimestamp && eLineEnd ) {
+#if 1
 #if 0
 				SYSTEMTIME	LocalTime;
 				GetLocalTime(&LocalTime);
@@ -651,6 +652,25 @@
 						LocalTime.wHour, LocalTime.wMinute, LocalTime.wSecond,
 						LocalTime.wMilliseconds);
 #else
+				// ƒ~ƒŠ•b‚à•\Ž¦‚·‚é‚悤‚ɕύX (2009.5.23 maya)
+				SYSTEMTIME LocalTime;
+				GetLocalTime(&LocalTime);
+				char strtime[29];
+				char week[][4] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
+				char month[][4] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
+				                   "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+				_snprintf_s(strtime, sizeof(strtime), _TRUNCATE,
+				            "%s %s %02d %02d:%02d:%02d.%03d %04d",
+				            week[LocalTime.wDayOfWeek],
+				            month[LocalTime.wMonth-1],
+				            LocalTime.wDay,
+				            LocalTime.wHour,
+				            LocalTime.wMinute,
+				            LocalTime.wSecond,
+				            LocalTime.wMilliseconds,
+				            LocalTime.wYear);
+#endif
+#else
 					time_t tick = time(NULL);
 					char *strtime = ctime(&tick); 
 #endif
@@ -659,8 +679,7 @@
 					_lwrite(LogVar->FileHandle,"\r\n",2);
 				}
 				_lwrite(LogVar->FileHandle,"[",1);
-				// •ÏŠ·‚µ‚½•¶Žš—ñ‚̏I’[‚É \n ‚ªŠÜ‚Ü‚ê‚Ä‚¢‚é‚Ì‚ÅŽæ‚菜‚­B
-				_lwrite(LogVar->FileHandle, strtime, strlen(strtime) - 1);
+				_lwrite(LogVar->FileHandle, strtime, strlen(strtime));
 				_lwrite(LogVar->FileHandle,"] ",2);
 			}
 			



Ttssh2-commit メーリングリストの案内