Develop and Download Open Source Software

Browse CVS Repository

Diff of /ttssh2/teraterm/source/teraterm/filesys.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3 by yutakakn, Sat May 7 09:49:24 2005 UTC revision 1.5 by yutakakn, Sun Jul 23 14:12:26 2006 UTC
# Line 238  void LogStart() Line 238  void LogStart()
238    
239          if (strlen(&(LogVar->FullName[LogVar->DirLen]))==0)          if (strlen(&(LogVar->FullName[LogVar->DirLen]))==0)
240          {          {
241                    // LOWORD
242                    // 0x0001 = Binary
243                    // HIWORD
244                    // 0x0001 = Append
245                  // 0x1000 = plain text (2005.2.20 yutaka)                  // 0x1000 = plain text (2005.2.20 yutaka)
246                    // 0x2000 = timestamp (2006.7.23 maya)
247                  // teraterm.iniの設定を見てからデフォルトオプションを決める。(2005.5.7 yutaka)                  // teraterm.iniの設定を見てからデフォルトオプションを決める。(2005.5.7 yutaka)
248                  Option = MAKELONG(ts.TransBin,ts.Append | (0x1000 * ts.LogTypePlainText));                  Option = MAKELONG(ts.TransBin,ts.Append |
249                                                      (0x1000 * ts.LogTypePlainText) |
250                                                      (0x2000 * ts.LogTimestamp));
251                  if (! (*GetTransFname)(LogVar, ts.FileDir, GTF_LOG, &Option))                  if (! (*GetTransFname)(LogVar, ts.FileDir, GTF_LOG, &Option))
252                  {                  {
253                          FreeFileVar(&LogVar);                          FreeFileVar(&LogVar);
# Line 255  void LogStart() Line 262  void LogStart()
262                  } else {                  } else {
263                          ts.LogTypePlainText = 0;                          ts.LogTypePlainText = 0;
264                  }                  }
265    
266                    if (ts.Append & 0x2000) {
267                            ts.LogTimestamp = 1;
268                    }
269                    else {
270                            ts.LogTimestamp = 0;
271                    }
272    
273                  ts.Append &= 0x1; // 1bitにマスクする                  ts.Append &= 0x1; // 1bitにマスクする
274    
275          }          }
# Line 430  void LogToFile() Line 445  void LogToFile()
445          {          {
446                  if (((cv.FilePause & OpLog)==0) && (! cv.ProtoFlag))                  if (((cv.FilePause & OpLog)==0) && (! cv.ProtoFlag))
447                  {                  {
448                            // 時刻を書き出す(2006.7.23 maya)
449                            // 日付フォーマットを日本ではなく世界標準に変更した (2006.7.23 yutaka)
450                            if (ts.LogTimestamp &&
451                                    (Start == 1 || Buf[Start-2] == 0x0a)) {
452    #if 0
453                                    SYSTEMTIME      LocalTime;
454                                    GetLocalTime(&LocalTime);
455                                    char strtime[27];
456    
457                                    // format time
458                                    sprintf(strtime, "[%04d/%02d/%02d %02d:%02d:%02d.%03d] ",
459                                                    LocalTime.wYear, LocalTime.wMonth,LocalTime.wDay,
460                                                    LocalTime.wHour, LocalTime.wMinute, LocalTime.wSecond,
461                                                    LocalTime.wMilliseconds);
462    #else
463                                            time_t tick = time(NULL);
464                                            char *strtime = ctime(&tick);
465    #endif
466    
467                                    // write to file
468                                    if (Start == 1 && ts.Append) {
469                                            _lwrite(LogVar->FileHandle,"\r\n",strlen("\r\n"));
470                                    }
471                                    _lwrite(LogVar->FileHandle,"[",1);
472                                    // 変換した文字列の終端に \n が含まれているので取り除く。
473                                    _lwrite(LogVar->FileHandle, strtime, strlen(strtime) - 1);
474                                    _lwrite(LogVar->FileHandle,"] ",2);
475                            }
476    
477                          _lwrite(LogVar->FileHandle,(PCHAR)&b,1);                          _lwrite(LogVar->FileHandle,(PCHAR)&b,1);
478                          (LogVar->ByteCount)++;                          (LogVar->ByteCount)++;
479                  }                  }
# Line 1076  void QVStart(int mode) Line 1120  void QVStart(int mode)
1120    
1121  /*  /*
1122   * $Log$   * $Log$
1123     * Revision 1.5  2006/07/23 14:12:26  yutakakn
1124     * ログに含める日付フォーマットを世界標準書式に変更した。
1125     *
1126     * Revision 1.4  2006/07/22 16:15:54  maya
1127     * ログ記録時に時刻も書き込む機能を追加した。
1128     *
1129   * Revision 1.3  2005/05/07 09:49:24  yutakakn   * Revision 1.3  2005/05/07 09:49:24  yutakakn
1130   * teraterm.iniに LogTypePlainText を追加した。   * teraterm.iniに LogTypePlainText を追加した。
1131   *   *

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26