Fix debugging

This commit is contained in:
Ron Pedde 2006-08-20 03:59:37 +00:00
parent 2f2dd3908c
commit 6dfcec0d60

View File

@ -27,6 +27,7 @@ int main(int argc, char *argv[]) {
int type=0; int type=0;
PARSETREE pt; PARSETREE pt;
char *configfile = "/etc/mt-daapd.conf"; char *configfile = "/etc/mt-daapd.conf";
int debuglevel=0;
char db_type[40]; char db_type[40];
char db_parms[PATH_MAX]; char db_parms[PATH_MAX];
int size; int size;
@ -39,7 +40,7 @@ int main(int argc, char *argv[]) {
configfile = optarg; configfile = optarg;
break; break;
case 'd': case 'd':
err_setlevel(atoi(optarg)); debuglevel = atoi(optarg);
break; break;
case 't': case 't':
type = atoi(optarg); type = atoi(optarg);
@ -50,12 +51,18 @@ int main(int argc, char *argv[]) {
} }
} }
err_setdebugmask("parse"); // err_setdebugmask("parse");
if(conf_read(configfile) != CONF_E_SUCCESS) { if(conf_read(configfile) != CONF_E_SUCCESS) {
fprintf(stderr,"could not read config file: %s\n",configfile); fprintf(stderr,"could not read config file: %s\n",configfile);
exit(1); exit(1);
} }
if(debuglevel) {
printf("Setting debug level to %d\n",debuglevel);
err_setlevel(debuglevel);
err_setdest(LOGDEST_STDERR);
}
size = sizeof(db_type); size = sizeof(db_type);
conf_get_string("general","db_type","sqlite",db_type,&size); conf_get_string("general","db_type","sqlite",db_type,&size);