Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv13564/src
Modified Files:
log.c main.c
Log Message:
Log full protocol data when srvx is given the --debug command line flag, rather than when compiled with -NDEBUG.
Index: log.c
===================================================================
RCS file: /cvsroot/srvx/services/src/log.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -r1.43 -r1.44
*** log.c 5 Sep 2002 14:57:22 -0000 1.43
--- log.c 21 Oct 2002 02:30:13 -0000 1.44
***************
*** 35,43 ****
{NULL, NULL, 0},
{NULL, "main.log", DEFAULT_SEVERITY_MASK},
- #ifdef NDEBUG
{NULL, "debug.log", 0},
- #else
- {NULL, "debug.log", DEFAULT_SEVERITY_MASK},
- #endif
{NULL, "chanserv.log", DEFAULT_SEVERITY_MASK},
{NULL, "opserv.log", DEFAULT_SEVERITY_MASK},
--- 35,39 ----
Index: main.c
===================================================================
RCS file: /cvsroot/srvx/services/src/main.c,v
retrieving revision 1.139
retrieving revision 1.140
diff -C2 -r1.139 -r1.140
*** main.c 21 Sep 2002 21:52:54 -0000 1.139
--- main.c 21 Oct 2002 02:30:13 -0000 1.140
***************
*** 581,592 ****
void usage(char *self) {
/* We can assume we have getopt_long(). */
! printf("Usage: %s [-c config] [-r log] [-f] [-V] [-v|-h]\n"
! "-c, --config selects a different configuration file.\n"
! "-f, --foreground run srvx in the foreground.\n"
! "-h, --help prints this usage message.\n"
! "-k, --check checks the configuration file's syntax.\n"
! "-r, --replay replay a log file (debug)\n"
! "-v, --version prints this program's version.\n"
! "-V, --verbose send log messages to the console.\n", self);
}
--- 581,593 ----
void usage(char *self) {
/* We can assume we have getopt_long(). */
! printf("Usage: %s [-c config] [-r log] [-d] [-f] [-V] [-v|-h]\n"
! "-c, --config selects a different configuration file.\n"
! "-d, --debug enables debug mode.\n"
! "-f, --foreground run srvx in the foreground.\n"
! "-h, --help prints this usage message.\n"
! "-k, --check checks the configuration file's syntax.\n"
! "-r, --replay replay a log file (debug)\n"
! "-v, --version prints this program's version.\n"
! "-V, --verbose send log messages to the console.\n", self);
}
***************
*** 625,629 ****
int main(int argc, char *argv[])
{
! int daemon;
pid_t pid = 0;
FILE *file_out;
--- 626,630 ----
int main(int argc, char *argv[])
{
! int daemon, debug;
pid_t pid = 0;
FILE *file_out;
***************
*** 631,634 ****
--- 632,636 ----
daemon = 1;
+ debug = 0;
silent = 1;
tools_init();
***************
*** 652,655 ****
--- 654,658 ----
{
{"config", 1, 0, 'c'},
+ {"debug", 0, 0, 'd'},
{"foreground", 0, 0, 'f'},
{"help", 0, 0, 'h'},
***************
*** 661,665 ****
};
! while ((c = getopt_long(argc, argv, "c:fhkr:vV", options, NULL)) != -1) {
switch(c) {
case 'c':
--- 664,668 ----
};
! while ((c = getopt_long(argc, argv, "c:kr:dfvVh", options, NULL)) != -1) {
switch(c) {
case 'c':
***************
*** 681,684 ****
--- 684,690 ----
}
break;
+ case 'd':
+ debug = 1;
+ break;
case 'f':
daemon = 0;
***************
*** 724,727 ****
--- 730,738 ----
}
init_logs();
+
+ if(debug)
+ {
+ log_modify_logging("debug", ">=other");
+ }
log(MAIN_LOG, LOG_INFO, "Initializing daemon...\n");
|