X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/656fa24481da0ce15dc352c70c5b79815b00a930..382908adb0d45df6bb519e8838e5aa91fb7434c7:/logging.c diff --git a/logging.c b/logging.c index 06f0678b..9e8b9f83 100644 --- a/logging.c +++ b/logging.c @@ -34,11 +34,21 @@ void logtraffic(void *handle, unsigned char c, int logmode) } /* - * Log an Event Log entry (used in SSH packet logging mode). + * Log an Event Log entry. Used in SSH packet logging mode; this is + * also as convenient a place as any to put the output of Event Log + * entries to stderr when a command-line tool is in verbose mode. + * (In particular, this is a better place to put it than in the + * front ends, because it only has to be done once for all + * platforms. Platforms which don't have a meaningful stderr can + * just avoid defining FLAG_STDERR. */ void log_eventlog(void *handle, char *event) { struct LogContext *ctx = (struct LogContext *)handle; + if ((flags & FLAG_STDERR) && (flags & FLAG_VERBOSE)) { + fprintf(stderr, "%s\n", event); + fflush(stderr); + } if (cfg.logtype != LGTYP_PACKETS) return; if (!ctx->lgfp)