- lgfp = fopen(currlogfilename, writemod);
- if (lgfp) { /* enter into event log */
- sprintf(buf, "%s session log (%s mode) to file : ",
+ ctx->lgfp = fopen(ctx->currlogfilename, writemod);
+ if (ctx->lgfp) { /* enter into event log */
+ /* --- write header line into log file */
+ fputs("=~=~=~=~=~=~=~=~=~=~=~= PuTTY log ", ctx->lgfp);
+ strftime(buf, 24, "%Y.%m.%d %H:%M:%S", &tm);
+ fputs(buf, ctx->lgfp);
+ fputs(" =~=~=~=~=~=~=~=~=~=~=~=\r\n", ctx->lgfp);
+
+ sprintf(buf, "%s session log (%s mode) to file: ",