diff --git a/src/main.c b/src/main.c index 8926308ca52..e57bfa40f87 100644 --- a/src/main.c +++ b/src/main.c @@ -169,7 +169,8 @@ Options:\n\ -b nr Maximum receive buffer size which will not be exceeded by\n\ auto-probing procedure even if OS allows\n\ -c Check configuration file for syntax errors\n\ - -d Debugging mode (multiple -d increase the level)\n\ + -d Debugging level control (multiple -d to increase the level from 0)\n\ + --debug=val Debugging level value\n\ -D Control how daemonize is done:\n\ -D..do not fork (almost) anyway;\n\ -DD..do not daemonize creator;\n\ @@ -1931,6 +1932,7 @@ int main(int argc, char** argv) {"loadmodule", required_argument, 0, KARGOPTVAL + 5}, {"modparam", required_argument, 0, KARGOPTVAL + 6}, {"log-engine", required_argument, 0, KARGOPTVAL + 7}, + {"debug", required_argument, 0, KARGOPTVAL + 8}, {0, 0, 0, 0 } }; @@ -1992,6 +1994,14 @@ int main(int argc, char** argv) case KARGOPTVAL+7: ksr_slog_init(optarg); break; + case KARGOPTVAL+8: + debug_flag = 1; + default_core_cfg.debug=(int)strtol(optarg, &tmp, 10); + if ((tmp==0) || (*tmp)){ + LM_ERR("bad debug level value: %s\n", optarg); + goto error; + } + break; default: if (c == 'h' || (optarg && strcmp(optarg, "-h") == 0)) { @@ -2153,6 +2163,7 @@ int main(int argc, char** argv) case KARGOPTVAL+5: case KARGOPTVAL+6: case KARGOPTVAL+7: + case KARGOPTVAL+8: break; /* long options */