- char *s_or_r = am_sender ? "send" : "recv";
-
- if (lp_transfer_logging(module_id)) {
- log_formatted(FLOG, lp_log_format(module_id), s_or_r,
- file, initial_stats, iflags, hlink);
- } else if (log_format && !am_server) {
- log_formatted(FINFO, log_format, s_or_r,
- file, initial_stats, iflags, hlink);
+ const char *p;
+
+ if (!format)
+ return 0;
+
+ for (p = format; (p = strchr(p, '%')) != NULL; ) {
+ if (*++p == '-')
+ p++;
+ while (isDigit(p))
+ p++;
+ if (!*p)
+ break;
+ if (*p == esc)
+ return 1;
+ }
+ return 0;
+}
+
+/* Log the transfer of a file. If the code is FCLIENT, the output just goes
+ * to stdout. If it is FLOG, it just goes to the log file. Otherwise we
+ * output to both. */
+void log_item(enum logcode code, struct file_struct *file,
+ struct stats *initial_stats, int iflags, const char *hlink)
+{
+ const char *s_or_r = am_sender ? "send" : "recv";
+
+ if (code != FLOG && stdout_format && !am_server) {
+ log_formatted(FCLIENT, stdout_format, s_or_r,
+ file, NULL, initial_stats, iflags, hlink);
+ }
+ if (code != FCLIENT && logfile_format && *logfile_format) {
+ log_formatted(FLOG, logfile_format, s_or_r,
+ file, NULL, initial_stats, iflags, hlink);