add --debug option to nexus
authorTero Marttila <terom@fixme.fi>
Fri, 27 Mar 2009 00:08:23 +0200
changeset 79 e26f972300e4
parent 78 941bb8379d3d
child 80 1b989bc67760
add --debug option to nexus
src/nexus.c
--- a/src/nexus.c	Thu Mar 26 23:59:04 2009 +0200
+++ b/src/nexus.c	Fri Mar 27 00:08:23 2009 +0200
@@ -22,6 +22,7 @@
     OPT_CHANNEL         = 'c',
     OPT_MODULE          = 'm',
     OPT_CONFIG          = 'C',
+    OPT_DEBUG           = 'd',
     
     /** Options without short names */
     _OPT_EXT_BEGIN      = 0x00ff,
@@ -37,6 +38,7 @@
     {"channel",         1,  NULL,   OPT_CHANNEL     },
     {"module",          1,  NULL,   OPT_MODULE      },
     {"config",          1,  NULL,   OPT_CONFIG      },
+    {"debug",           0,  NULL,   OPT_DEBUG       },
     {0,                 0,  0,      0               },
 };
 
@@ -52,6 +54,7 @@
     printf(" --channel / -c         add an IRC channel using '<network>:<channel>' format\n");
     printf(" --module / -m          add a module using '<name>:<path>' format\n");
     printf(" --config / -C          add a module configuration option using '<mod_name>:<name>[:<value>]' format\n");
+    printf(" --debug / -d           set logging level to DEBUG\n");
 }
 
 /**
@@ -243,6 +246,10 @@
                     return ERROR_CODE(err);
 
                 break;
+            
+            case OPT_DEBUG:
+                set_log_level(LOG_DEBUG);
+                break;
 
             case '?':
                 usage(argv[0]);