Mercurial > hg > freeDiameter
diff freeDiameterd/main.c @ 1078:74bba7975864
Cleanup the timing data and fd_msg_log feature that will be replaced by the new hooks mechanism. Kept the calls to fd_msg_log in comments to find the locations easily. WORK IN PROGRESS.
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Tue, 30 Apr 2013 15:37:57 +0800 |
parents | 155d45d06530 |
children | 758b21ae6c3e |
line wrap: on
line diff
--- a/freeDiameterd/main.c Tue Apr 30 12:09:32 2013 +0800 +++ b/freeDiameterd/main.c Tue Apr 30 15:37:57 2013 +0800 @@ -48,7 +48,6 @@ static char *conffile = NULL; static int gnutls_debug = 0; -static int fd_msg_log_enabled = 0; /* all logs disabled by default, this field is a bitfield of enabled FD_MSG_LOG_* */ /* gnutls debug */ static void fd_gnutls_debug(int level, const char * str) { @@ -87,25 +86,6 @@ TRACE_DEBUG(INFO, "Enabled GNUTLS debug at level %d", gnutls_debug); } - /* set messages logging */ - if (fd_msg_log_enabled) { - if (fd_msg_log_enabled & (1 << FD_MSG_LOG_DROPPED)) { - CHECK_FCT( fd_msg_log_config(FD_MSG_LOG_DROPPED, FD_MSG_LOGTO_DEBUGONLY, NULL) ); - } - if (fd_msg_log_enabled & (1 << FD_MSG_LOG_RECEIVED)) { - CHECK_FCT( fd_msg_log_config(FD_MSG_LOG_RECEIVED, FD_MSG_LOGTO_DEBUGONLY, NULL) ); - } - if (fd_msg_log_enabled & (1 << FD_MSG_LOG_SENT)) { - CHECK_FCT( fd_msg_log_config(FD_MSG_LOG_SENT, FD_MSG_LOGTO_DEBUGONLY, NULL) ); - } - if (fd_msg_log_enabled & (1 << FD_MSG_LOG_NODELIVER)) { - CHECK_FCT( fd_msg_log_config(FD_MSG_LOG_NODELIVER, FD_MSG_LOGTO_DEBUGONLY, NULL) ); - } - if (fd_msg_log_enabled & (1 << FD_MSG_LOG_TIMING)) { - CHECK_FCT( fd_msg_log_config(FD_MSG_LOG_TIMING, FD_MSG_LOGTO_DEBUGONLY, NULL) ); - } - } - /* Allow SIGINT and SIGTERM from this point to terminate the application */ CHECK_POSIX( pthread_create(&signals_thr, NULL, catch_signals, NULL) ); @@ -168,9 +148,7 @@ printf( " -h, --help Print help and exit\n" " -V, --version Print version and exit\n" " -c, --config=filename Read configuration from this file instead of the \n" - " default location (" DEFAULT_CONF_PATH "/" FD_DEFAULT_CONF_FILENAME ").\n" - " -M, --enable_msg_log=( DROPPED | RECEIVED | SENT | NODELIVER | TIMING )\n" - " Enable logging of these messages in the output.\n"); + " default location (" DEFAULT_CONF_PATH "/" FD_DEFAULT_CONF_FILENAME ").\n"); printf( "\nDebug:\n" " These options are mostly useful for developers\n" " -l, --dbglocale Set the locale for error messages\n" @@ -196,7 +174,6 @@ { "dbg_func", required_argument, NULL, 'f' }, { "dbg_file", required_argument, NULL, 'F' }, { "dbg_gnutls", required_argument, NULL, 'g' }, - { "enable_msg_log", optional_argument, NULL, 'M' }, { NULL, 0, NULL, 0 } }; @@ -231,30 +208,6 @@ } break; - case 'M': /* disable logging of these messages */ - if (optarg) { - if (!strcmp(optarg, "DROPPED")) { - fd_msg_log_enabled |= 1 << FD_MSG_LOG_DROPPED; - } else - if (!strcmp(optarg, "RECEIVED")) { - fd_msg_log_enabled |= 1 << FD_MSG_LOG_RECEIVED; - } else - if (!strcmp(optarg, "SENT")) { - fd_msg_log_enabled |= 1 << FD_MSG_LOG_SENT; - } else - if (!strcmp(optarg, "NODELIVER")) { - fd_msg_log_enabled |= 1 << FD_MSG_LOG_NODELIVER; - } else - if (!strcmp(optarg, "TIMING")) { - fd_msg_log_enabled |= 1 << FD_MSG_LOG_TIMING; - } else { - main_help(); - exit(0); - } - } else { - fd_msg_log_enabled = -1; /* all logs enabled */ - } - case 'd': /* Increase verbosity of debug messages. */ fd_g_debug_lvl++; break;