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.2 by yutakakn, Sun Feb 20 14:51:29 2005 UTC revision 1.4 by maya, Sat Jul 22 16:15:54 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                  Option = MAKELONG(ts.TransBin,ts.Append | 0x1000);                  // 0x2000 = timestamp (2006.7.23 maya)
247                    // teraterm.iniの設定を見てからデフォルトオプションを決める。(2005.5.7 yutaka)
248                    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 254  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 429  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                            if (ts.LogTimestamp &&
450                                    (Start == 1 || Buf[Start-2] == 0x0a)) {
451                                    SYSTEMTIME      LocalTime;
452                                    GetLocalTime(&LocalTime);
453                                    char strtime[27];
454    
455                                    // format time
456                                    sprintf(strtime, "[%04d/%02d/%02d %02d:%02d:%02d.%03d] ",
457                                                    LocalTime.wYear, LocalTime.wMonth,LocalTime.wDay,
458                                                    LocalTime.wHour, LocalTime.wMinute, LocalTime.wSecond,
459                                                    LocalTime.wMilliseconds);
460    
461                                    // write to file
462                                    if (Start == 1 && ts.Append) {
463                                            _lwrite(LogVar->FileHandle,"\r\n",strlen("\r\n"));
464                                    }
465                                    _lwrite(LogVar->FileHandle,strtime,strlen(strtime));
466                            }
467    
468                          _lwrite(LogVar->FileHandle,(PCHAR)&b,1);                          _lwrite(LogVar->FileHandle,(PCHAR)&b,1);
469                          (LogVar->ByteCount)++;                          (LogVar->ByteCount)++;
470                  }                  }
# Line 1075  void QVStart(int mode) Line 1111  void QVStart(int mode)
1111    
1112  /*  /*
1113   * $Log$   * $Log$
1114     * Revision 1.4  2006/07/22 16:15:54  maya
1115     * ログ記録時に時刻も書き込む機能を追加した。
1116     *
1117     * Revision 1.3  2005/05/07 09:49:24  yutakakn
1118     * teraterm.iniに LogTypePlainText を追加した。
1119     *
1120   * Revision 1.2  2005/02/20 14:51:29  yutakakn   * Revision 1.2  2005/02/20 14:51:29  yutakakn
1121   * ログファイルの種別に"plain text"を追加。このオプションが有効の場合は、ログファイルに   * ログファイルの種別に"plain text"を追加。このオプションが有効の場合は、ログファイルに
1122   * ASCII非表示文字の採取をしない。   * ASCII非表示文字の採取をしない。

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

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