*/
#include "rsync.h"
+extern int verbose;
extern int dry_run;
extern int am_daemon;
extern int am_server;
return NULL;
}
-void log_open(void)
-{
- if (logfname && !logfile) {
- extern int orig_umask;
- int old_umask = umask(022 | orig_umask);
- logfile = fopen(logfname, "a");
- umask(old_umask);
- if (!logfile) {
- am_daemon = 0; /* avoid trying to log again */
- rsyserr(FERROR, errno, "fopen() of log-file failed");
- exit_cleanup(RERR_FILESELECT);
- }
- }
-}
-
-void log_close(void)
-{
- if (logfile) {
- fclose(logfile);
- logfile = NULL;
- }
-}
static void logit(int priority, char *buf)
{
#endif
}
+void log_open(void)
+{
+ if (logfname && !logfile) {
+ extern int orig_umask;
+ int old_umask = umask(022 | orig_umask);
+ logfile = fopen(logfname, "a");
+ umask(old_umask);
+ if (!logfile) {
+ am_daemon = 0; /* avoid trying to log again */
+ rsyserr(FERROR, errno, "fopen() of log-file failed");
+ exit_cleanup(RERR_FILESELECT);
+ }
+ }
+}
+
+void log_close(void)
+{
+ if (logfile) {
+ fclose(logfile);
+ logfile = NULL;
+ }
+}
+
/* this is the underlying (unformatted) rsync debugging function. Call
* it with FINFO, FERROR or FLOG */
void rwrite(enum logcode code, char *buf, int len)
file.mode = mode;
file.basename = fname;
- if (am_server && protocol_version >= 29 && len < MAXPATHLEN) {
+ if (!verbose && !log_format)
+ ;
+ else if (am_server && protocol_version >= 29 && len < MAXPATHLEN) {
if (S_ISDIR(mode))
len++; /* directories include trailing null */
send_msg(MSG_DELETED, fname, len);
log_formatted(FCLIENT, fmt, "del.", &file, &stats, ITEM_DELETED);
}
- if (!am_daemon || dry_run)
+ if (!am_daemon || dry_run || !lp_transfer_logging(module_id))
return;
fmt = daemon_log_format_has_o_or_i ? lp_log_format(module_id) : "%i %n";