aboutsummaryrefslogtreecommitdiff
path: root/gmid.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-01-27 23:14:16 +0000
committerOmar Polo <op@omarpolo.com>2021-01-27 23:14:16 +0000
commit8904fa0e64ec12b5ca6f07f39c2d990bc557d701 (patch)
tree0cea3031da53fb9ee08d3a729857ee2211adc857 /gmid.c
parent08a2fee055cc3d9f958b857765a3a6e60710ff26 (diff)
-v for verbose logging
Diffstat (limited to 'gmid.c')
-rw-r--r--gmid.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gmid.c b/gmid.c
index 272a39d..09deac2 100644
--- a/gmid.c
+++ b/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 == '/')