aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2016-10-12 14:15:25 +0200
committerGravatar Christian Hesse <mail@eworm.de>2016-10-12 14:15:25 +0200
commitbedacf9c09b718f96ae559607cbdbc822570f004 (patch)
tree895fcfc911e80e09af689433b30cda9e45adfa1f
parent34070a53d22e42660ff2d6280c3cbedce5536ec4 (diff)
downloadpaccache-bedacf9c09b718f96ae559607cbdbc822570f004.tar.gz
paccache-bedacf9c09b718f96ae559607cbdbc822570f004.tar.zst
print only if verbose
-rw-r--r--pacredir.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/pacredir.c b/pacredir.c
index f1cd9de..a6c4813 100644
--- a/pacredir.c
+++ b/pacredir.c
@@ -374,17 +374,20 @@ static int ahc_echo(void * cls,
/* skip host if offline or had a bad request within last BADTIME seconds */
if (service->online == 0) {
- write_log(stdout, "Service %s on host %s is offline, skipping\n",
- dbfile ? PACDBSERVE : PACSERVE, tmphosts->host);
+ if (verbose > 0)
+ write_log(stdout, "Service %s on host %s is offline, skipping\n",
+ dbfile ? PACDBSERVE : PACSERVE, tmphosts->host);
tmphosts = tmphosts->next;
continue;
} else if (badtime > tv.tv_sec) {
- /* write the time to buffer ctime, then strip the line break */
- ctime_r(&badtime, ctime);
- ctime[strlen(ctime) - 1] = '\0';
+ if (verbose > 0) {
+ /* write the time to buffer ctime, then strip the line break */
+ ctime_r(&badtime, ctime);
+ ctime[strlen(ctime) - 1] = '\0';
- write_log(stdout, "Service %s on host %s is marked bad until %s, skipping\n",
- dbfile ? PACDBSERVE : PACSERVE, tmphosts->host, ctime);
+ write_log(stdout, "Service %s on host %s is marked bad until %s, skipping\n",
+ dbfile ? PACDBSERVE : PACSERVE, tmphosts->host, ctime);
+ }
tmphosts = tmphosts->next;
continue;
}