]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Add the -log option, which activates full session logging. Should be
authorSimon Tatham <anakin@pobox.com>
Mon, 14 Oct 2002 10:33:34 +0000 (10:33 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 14 Oct 2002 10:33:34 +0000 (10:33 +0000)
handy next time I need to debug any weird terminal problems...

[originally from svn r2050]

unix/pterm.c

index 03017ec41ce7372bb46144af6da2fda8048019c4..77743edf257f8288b9dacd84010ebb38e6d4c451 100644 (file)
@@ -59,8 +59,10 @@ void ldisc_update(int echo, int edit)
 int askappend(char *filename)
 {
     /*
-     * FIXME: for the moment we just wipe the log file. Since I
-     * haven't yet enabled logging, this shouldn't matter yet!
+     * Logging in an xterm-alike is liable to be something you only
+     * do at serious diagnostic need. Hence, I'm going to take the
+     * easy option for now and assume we always want to overwrite
+     * log files. I can always make it properly configurable later.
      */
     return 2;
 }
@@ -1253,6 +1255,14 @@ int main(int argc, char **argv)
            } else
                err = 1, fprintf(stderr, "pterm: -T expects an argument\n");
        }
+       if (!strcmp(p, "-log")) {
+           if (--argc > 0) {
+               strncpy(cfg.logfilename, *++argv, sizeof(cfg.logfilename));
+               cfg.logfilename[sizeof(cfg.logfilename)-1] = '\0';
+               cfg.logtype = LGTYP_DEBUG;
+           } else
+               err = 1, fprintf(stderr, "pterm: -log expects an argument\n");
+       }
        if (!strcmp(p, "-hide")) {
            cfg.hide_mouseptr = 1;
        }