From e1813f5803ab4a0d001000662db8257966c04f76 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 14 Mar 2017 11:19:59 -0300 Subject: [PATCH] unify log initialisation code in villas-hook --- src/hook.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hook.c b/src/hook.c index 0b7dfee5e..d74c62e02 100644 --- a/src/hook.c +++ b/src/hook.c @@ -39,7 +39,11 @@ static void usage() int main(int argc, char *argv[]) { - int j, ret, cnt = 1; + int j, ret, level, cnt; + + /* Default values */ + level = V; + cnt = 1; char *name, *parameter; @@ -57,7 +61,7 @@ int main(int argc, char *argv[]) cnt = atoi(optarg); break; case 'd': - log.level = atoi(optarg); + level = atoi(optarg); break; case 'h': case '?': @@ -66,7 +70,7 @@ int main(int argc, char *argv[]) } } - log_init(&log, log.level, LOG_ALL); + log_init(&log, level, LOG_ALL); memory_init(DEFAULT_NR_HUGEPAGES); if (argc < optind + 1) {