summaryrefslogtreecommitdiffstats
path: root/proxy/src/gssproxy.c
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2015-11-10 22:59:05 -0500
committerRobbie Harwood <rharwood@redhat.com>2015-12-01 17:33:42 -0500
commit71d316dfc51bcb9e18da61fb7299bb021523cde4 (patch)
treeac4046a1df6db33c293beee31c0fe190ddb2ab85 /proxy/src/gssproxy.c
parent0577e929ef896944b2f852f0c3071684e9b282aa (diff)
downloadgss-proxy-71d316dfc51bcb9e18da61fb7299bb021523cde4.tar.gz
gss-proxy-71d316dfc51bcb9e18da61fb7299bb021523cde4.tar.xz
gss-proxy-71d316dfc51bcb9e18da61fb7299bb021523cde4.zip
Add options to specify a debug level
Print only messages that are at that level or lower. Also add timestamps to debug messages. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Robbie Harwood <rharwood@redhat.com>
Diffstat (limited to 'proxy/src/gssproxy.c')
-rw-r--r--proxy/src/gssproxy.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/proxy/src/gssproxy.c b/proxy/src/gssproxy.c
index 1e99f88..bcf236b 100644
--- a/proxy/src/gssproxy.c
+++ b/proxy/src/gssproxy.c
@@ -149,6 +149,7 @@ int main(int argc, const char *argv[])
int opt_interactive = 0;
int opt_version = 0;
int opt_debug = 0;
+ int opt_debug_level = 0;
verto_ctx *vctx;
verto_ev *ev;
int wait_fd;
@@ -168,8 +169,10 @@ int main(int argc, const char *argv[])
_("Specify a custom default socket"), NULL}, \
{"debug", 'd', POPT_ARG_NONE, &opt_debug, 0, \
_("Enable debugging"), NULL}, \
- {"version", '\0', POPT_ARG_NONE, &opt_version, 0, \
- _("Print version number and exit"), NULL }, \
+ {"debug-level", '\0', POPT_ARG_INT, &opt_debug_level, 0, \
+ _("Set debugging level"), NULL}, \
+ {"version", '\0', POPT_ARG_NONE, &opt_version, 0, \
+ _("Print version number and exit"), NULL }, \
POPT_TABLEEND
};
@@ -189,8 +192,8 @@ int main(int argc, const char *argv[])
return 0;
}
- if (opt_debug) {
- gp_debug_enable();
+ if (opt_debug || opt_debug_level > 0) {
+ gp_debug_enable(opt_debug_level);
}
if (opt_daemon && opt_interactive) {