| 248 |
Option = MAKELONG(ts.TransBin,ts.Append | |
Option = MAKELONG(ts.TransBin,ts.Append | |
| 249 |
(0x1000 * ts.LogTypePlainText) | |
(0x1000 * ts.LogTypePlainText) | |
| 250 |
(0x2000 * ts.LogTimestamp)); |
(0x2000 * ts.LogTimestamp)); |
| 251 |
|
|
| 252 |
|
// ログのデフォルトファイル名を設定 (2006.8.28 maya) |
| 253 |
|
strncat(LogVar->FullName, ts.LogDefaultName, sizeof(LogVar->FullName)); |
| 254 |
|
ParseStrftimeFileName(LogVar->FullName); |
| 255 |
|
|
| 256 |
if (! (*GetTransFname)(LogVar, ts.FileDir, GTF_LOG, &Option)) |
if (! (*GetTransFname)(LogVar, ts.FileDir, GTF_LOG, &Option)) |
| 257 |
{ |
{ |
| 258 |
FreeFileVar(&LogVar); |
FreeFileVar(&LogVar); |
| 451 |
if (((cv.FilePause & OpLog)==0) && (! cv.ProtoFlag)) |
if (((cv.FilePause & OpLog)==0) && (! cv.ProtoFlag)) |
| 452 |
{ |
{ |
| 453 |
// 時刻を書き出す(2006.7.23 maya) |
// 時刻を書き出す(2006.7.23 maya) |
| 454 |
|
// 日付フォーマットを日本ではなく世界標準に変更した (2006.7.23 yutaka) |
| 455 |
if (ts.LogTimestamp && |
if (ts.LogTimestamp && |
| 456 |
(Start == 1 || Buf[Start-2] == 0x0a)) { |
(Start == 1 || Buf[Start-2] == 0x0a)) { |
| 457 |
|
#if 0 |
| 458 |
SYSTEMTIME LocalTime; |
SYSTEMTIME LocalTime; |
| 459 |
GetLocalTime(&LocalTime); |
GetLocalTime(&LocalTime); |
| 460 |
char strtime[27]; |
char strtime[27]; |
| 464 |
LocalTime.wYear, LocalTime.wMonth,LocalTime.wDay, |
LocalTime.wYear, LocalTime.wMonth,LocalTime.wDay, |
| 465 |
LocalTime.wHour, LocalTime.wMinute, LocalTime.wSecond, |
LocalTime.wHour, LocalTime.wMinute, LocalTime.wSecond, |
| 466 |
LocalTime.wMilliseconds); |
LocalTime.wMilliseconds); |
| 467 |
|
#else |
| 468 |
|
time_t tick = time(NULL); |
| 469 |
|
char *strtime = ctime(&tick); |
| 470 |
|
#endif |
| 471 |
|
|
| 472 |
// write to file |
// write to file |
| 473 |
if (Start == 1 && ts.Append) { |
if (Start == 1 && ts.Append) { |
| 474 |
_lwrite(LogVar->FileHandle,"\r\n",strlen("\r\n")); |
_lwrite(LogVar->FileHandle,"\r\n",strlen("\r\n")); |
| 475 |
} |
} |
| 476 |
_lwrite(LogVar->FileHandle,strtime,strlen(strtime)); |
_lwrite(LogVar->FileHandle,"[",1); |
| 477 |
|
// 変換した文字列の終端に \n が含まれているので取り除く。 |
| 478 |
|
_lwrite(LogVar->FileHandle, strtime, strlen(strtime) - 1); |
| 479 |
|
_lwrite(LogVar->FileHandle,"] ",2); |
| 480 |
} |
} |
| 481 |
|
|
| 482 |
_lwrite(LogVar->FileHandle,(PCHAR)&b,1); |
_lwrite(LogVar->FileHandle,(PCHAR)&b,1); |
| 579 |
if (strlen(&(SendVar->FullName[SendVar->DirLen]))==0) |
if (strlen(&(SendVar->FullName[SendVar->DirLen]))==0) |
| 580 |
{ |
{ |
| 581 |
Option = MAKELONG(ts.TransBin,0); |
Option = MAKELONG(ts.TransBin,0); |
| 582 |
|
SendVar->FullName[0] = 0; |
| 583 |
if (! (*GetTransFname)(SendVar, ts.FileDir, GTF_SEND, &Option)) |
if (! (*GetTransFname)(SendVar, ts.FileDir, GTF_SEND, &Option)) |
| 584 |
{ |
{ |
| 585 |
FileTransEnd(OpSendFile); |
FileTransEnd(OpSendFile); |
| 1066 |
FileVar->OpId = OpBPSend; |
FileVar->OpId = OpBPSend; |
| 1067 |
if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0) |
if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0) |
| 1068 |
{ |
{ |
| 1069 |
|
FileVar->FullName[0] = 0; |
| 1070 |
if (! (*GetTransFname)(FileVar, ts.FileDir, GTF_BP, &Option)) |
if (! (*GetTransFname)(FileVar, ts.FileDir, GTF_BP, &Option)) |
| 1071 |
{ |
{ |
| 1072 |
ProtoEnd(); |
ProtoEnd(); |
| 1127 |
|
|
| 1128 |
/* |
/* |
| 1129 |
* $Log$ |
* $Log$ |
| 1130 |
|
* Revision 1.6 2006/08/28 12:27:16 maya |
| 1131 |
|
* デフォルトのログファイル名を指定できるようにした。 |
| 1132 |
|
* エディットコントロールを "Additional settings" ダイアログに追加した。 |
| 1133 |
|
* teraterm.ini ファイルに LogDefaultName エントリを追加した。 |
| 1134 |
|
* ファイル名に strftime のフォーマットを使えるようにした。 |
| 1135 |
|
* |
| 1136 |
|
* Revision 1.5 2006/07/23 14:12:26 yutakakn |
| 1137 |
|
* ログに含める日付フォーマットを世界標準書式に変更した。 |
| 1138 |
|
* |
| 1139 |
* Revision 1.4 2006/07/22 16:15:54 maya |
* Revision 1.4 2006/07/22 16:15:54 maya |
| 1140 |
* ログ記録時に時刻も書き込む機能を追加した。 |
* ログ記録時に時刻も書き込む機能を追加した。 |
| 1141 |
* |
* |