Use symbolic names for loglevels and clean up the ggo mess.
[paraslash.git] / recv.c
diff --git a/recv.c b/recv.c
index 2386c1ef58930f140109918764acba5266c33a13..df8b9ce99e445f3acce568486c02878276f03576 100644 (file)
--- a/recv.c
+++ b/recv.c
 #include "recv.h"
 #include "recv.cmdline.h"
 #include "fd.h"
+#include "string.h"
 #include "error.h"
 #include "stdout.h"
 
 /** the gengetopt args info struct */
 struct recv_args_info conf;
 
-/** always log to stderr */
-INIT_STDERR_LOGGING(conf.loglevel_arg);
+static int loglevel;
+/** Always log to stderr. */
+INIT_STDERR_LOGGING(loglevel);
 
 /** init array of error codes used by para_recv */
 INIT_RECV_ERRLISTS;
@@ -85,6 +87,7 @@ int main(int argc, char *argv[])
                PARA_EMERG_LOG("parse failed\n");
                goto out;
        }
+       loglevel = get_loglevel_by_name(conf.loglevel_arg);
        r = &receivers[receiver_num];
        rn.receiver = r;
        ret = r->open(&rn);