commit 8904fa0e64ec12b5ca6f07f39c2d990bc557d701 from: Omar Polo date: Wed Jan 27 23:14:16 2021 UTC -v for verbose logging commit - 08a2fee055cc3d9f958b857765a3a6e60710ff26 commit + 8904fa0e64ec12b5ca6f07f39c2d990bc557d701 blob - 487afdd27f0a98a858342c49dc5edd6cb9e90b28 blob + ce05e5042515d3320eac34dab099c28e1870df51 --- gmid.1 +++ gmid.1 @@ -23,7 +23,7 @@ .Op Fl fn .Op Fl c Ar config | -.Op Fl 6h +.Op Fl 6hv .Op Fl d Pa certs-dir .Op Fl H Ar hostname .Op Fl p Ar port @@ -88,6 +88,8 @@ would be automatically generated. Print the usage and exit. .It Fl p Ar port The port to listen on, by default 1965. +.It Fl v +Increase the verbosity of the logs. .It Fl x Pa path Enable execution of CGI scripts. See the description of the blob - 272a39d3499d0115c4ef3b9d777e29e152bba6db blob + 09deac2a3d54de2b4c4d1751840e0a6806fec013 --- gmid.c +++ gmid.c @@ -32,7 +32,7 @@ struct vhost hosts[HOSTSLEN]; -int exfd, foreground; +int exfd, foreground, verbose; struct conf conf; @@ -65,6 +65,11 @@ logs(int priority, struct client *c, int ec; va_list ap; + if (foreground && !verbose) { + if (priority == LOG_DEBUG || priority == LOG_INFO) + return; + } + va_start(ap, fmt); if (c == NULL) { @@ -476,7 +481,7 @@ main(int argc, char **argv) init_config(); - while ((ch = getopt(argc, argv, "6c:d:fH:hnp:x:")) != -1) { + while ((ch = getopt(argc, argv, "6c:d:fH:hnp:vx:")) != -1) { switch (ch) { case '6': conf.ipv6 = 1; @@ -514,6 +519,10 @@ main(int argc, char **argv) configless = 1; break; + case 'v': + verbose = 1; + break; + case 'x': /* drop the starting / (if any) */ if (*optarg == '/')