Changes in freeDiameterd/main.c [931:155d45d06530:1081:758b21ae6c3e] in freeDiameter
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameterd/main.c
r931 r1081 49 49 static char *conffile = NULL; 50 50 static int gnutls_debug = 0; 51 static int fd_msg_log_enabled = 0; /* all logs disabled by default, this field is a bitfield of enabled FD_MSG_LOG_* */52 51 53 52 /* gnutls debug */ … … 88 87 } 89 88 90 /* set messages logging */91 if (fd_msg_log_enabled) {92 if (fd_msg_log_enabled & (1 << FD_MSG_LOG_DROPPED)) {93 CHECK_FCT( fd_msg_log_config(FD_MSG_LOG_DROPPED, FD_MSG_LOGTO_DEBUGONLY, NULL) );94 }95 if (fd_msg_log_enabled & (1 << FD_MSG_LOG_RECEIVED)) {96 CHECK_FCT( fd_msg_log_config(FD_MSG_LOG_RECEIVED, FD_MSG_LOGTO_DEBUGONLY, NULL) );97 }98 if (fd_msg_log_enabled & (1 << FD_MSG_LOG_SENT)) {99 CHECK_FCT( fd_msg_log_config(FD_MSG_LOG_SENT, FD_MSG_LOGTO_DEBUGONLY, NULL) );100 }101 if (fd_msg_log_enabled & (1 << FD_MSG_LOG_NODELIVER)) {102 CHECK_FCT( fd_msg_log_config(FD_MSG_LOG_NODELIVER, FD_MSG_LOGTO_DEBUGONLY, NULL) );103 }104 if (fd_msg_log_enabled & (1 << FD_MSG_LOG_TIMING)) {105 CHECK_FCT( fd_msg_log_config(FD_MSG_LOG_TIMING, FD_MSG_LOGTO_DEBUGONLY, NULL) );106 }107 }108 109 89 /* Allow SIGINT and SIGTERM from this point to terminate the application */ 110 90 CHECK_POSIX( pthread_create(&signals_thr, NULL, catch_signals, NULL) ); … … 169 149 " -V, --version Print version and exit\n" 170 150 " -c, --config=filename Read configuration from this file instead of the \n" 171 " default location (" DEFAULT_CONF_PATH "/" FD_DEFAULT_CONF_FILENAME ").\n" 172 " -M, --enable_msg_log=( DROPPED | RECEIVED | SENT | NODELIVER | TIMING )\n" 173 " Enable logging of these messages in the output.\n"); 151 " default location (" DEFAULT_CONF_PATH "/" FD_DEFAULT_CONF_FILENAME ").\n"); 174 152 printf( "\nDebug:\n" 175 153 " These options are mostly useful for developers\n" 176 154 " -l, --dbglocale Set the locale for error messages\n" 177 " -d, --debug Increase verbosity of debug messages \n"178 " -q, --quiet Decrease verbosity then remove debug messages\n"155 " -d, --debug Increase verbosity of debug messages if default logger is used\n" 156 " -q, --quiet Decrease verbosity if default logger is used\n" 179 157 " --dbg_gnutls <int> Enable GNU TLS debug at level <int>\n"); 180 158 } … … 197 175 { "dbg_file", required_argument, NULL, 'F' }, 198 176 { "dbg_gnutls", required_argument, NULL, 'g' }, 199 { "enable_msg_log", optional_argument, NULL, 'M' },200 177 { NULL, 0, NULL, 0 } 201 178 }; … … 232 209 break; 233 210 234 case 'M': /* disable logging of these messages */235 if (optarg) {236 if (!strcmp(optarg, "DROPPED")) {237 fd_msg_log_enabled |= 1 << FD_MSG_LOG_DROPPED;238 } else239 if (!strcmp(optarg, "RECEIVED")) {240 fd_msg_log_enabled |= 1 << FD_MSG_LOG_RECEIVED;241 } else242 if (!strcmp(optarg, "SENT")) {243 fd_msg_log_enabled |= 1 << FD_MSG_LOG_SENT;244 } else245 if (!strcmp(optarg, "NODELIVER")) {246 fd_msg_log_enabled |= 1 << FD_MSG_LOG_NODELIVER;247 } else248 if (!strcmp(optarg, "TIMING")) {249 fd_msg_log_enabled |= 1 << FD_MSG_LOG_TIMING;250 } else {251 main_help();252 exit(0);253 }254 } else {255 fd_msg_log_enabled = -1; /* all logs enabled */256 }257 258 211 case 'd': /* Increase verbosity of debug messages. */ 259 212 fd_g_debug_lvl++;
Note: See TracChangeset
for help on using the changeset viewer.