"Always overwrite it", I(LGXF_OVR),
"Always append to the end of it", I(LGXF_APN),
"Ask the user every time", I(LGXF_ASK), NULL);
+ ctrl_checkbox(s, "Flush log file frequently", 'u',
+ HELPCTX(logging_flush),
+ dlg_stdcheckbox_handler, I(offsetof(Config,logflush)));
if ((midsession && protocol == PROT_SSH) ||
(!midsession && backends[3].name != NULL)) {
automatic behaviour, but to ask the user every time the problem
comes up.
+\S{config-logflush} \q{Flush log file frequently}
+
+\cfg{winhelp-topic}{logging.flush}
+
+This option allows you to control how frequently logged data is
+flushed to disc. By default, PuTTY will flush data as soon as it is
+displayed, so that if you view the log file while a session is still
+open, it will be up to date; and if the client system crashes, there's
+a greater chance that the data will be preserved.
+
+However, this can incur a performance penalty. If PuTTY is running
+slowly with logging enabled, you could try unchecking this option. Be
+warned that the log file may not always be up to date as a result
+(although it will of course be flushed when it is closed, for instance
+at the end of a session).
+
\S{config-logssh} Options specific to SSH packet logging
These options only apply if SSH packet data is being logged.
Filename logfilename;
int logtype;
int logxfovr;
+ int logflush;
int logomitpass;
int logomitdata;
int hide_mouseptr;
write_setting_filename(sesskey, "LogFileName", cfg->logfilename);
write_setting_i(sesskey, "LogType", cfg->logtype);
write_setting_i(sesskey, "LogFileClash", cfg->logxfovr);
+ write_setting_i(sesskey, "LogFlush", cfg->logflush);
write_setting_i(sesskey, "SSHLogOmitPasswords", cfg->logomitpass);
write_setting_i(sesskey, "SSHLogOmitData", cfg->logomitdata);
p = "raw";
gppfile(sesskey, "LogFileName", &cfg->logfilename);
gppi(sesskey, "LogType", 0, &cfg->logtype);
gppi(sesskey, "LogFileClash", LGXF_ASK, &cfg->logxfovr);
+ gppi(sesskey, "LogFlush", 1, &cfg->logflush);
gppi(sesskey, "SSHLogOmitPasswords", 1, &cfg->logomitpass);
gppi(sesskey, "SSHLogOmitData", 0, &cfg->logomitdata);
}
term_print_flush(term);
- logflush(term->logctx);
+ if (term->cfg.logflush)
+ logflush(term->logctx);
}
/*
#define WINHELP_CTX_logging_main "logging.main"
#define WINHELP_CTX_logging_filename "logging.filename"
#define WINHELP_CTX_logging_exists "logging.exists"
+#define WINHELP_CTX_logging_flush "logging.flush"
#define WINHELP_CTX_logging_ssh_omit_password "logging.ssh.omitpassword"
#define WINHELP_CTX_logging_ssh_omit_data "logging.ssh.omitdata"
#define WINHELP_CTX_keyboard_backspace "keyboard.backspace"