improve logging verbosity

adapt to changes in log module
This commit is contained in:
Enno Rehling 2012-05-16 09:49:28 +02:00
parent 5de2e790a3
commit 3c1982da4c
2 changed files with 19 additions and 2 deletions

View File

@ -105,6 +105,23 @@ static int parse_args(int argc, char **argv, int *exitcode)
} }
} }
switch (verbosity) {
case 0:
log_stderr = 0;
break;
case 1:
log_stderr = LOG_CPERROR;
break;
case 2:
log_stderr = LOG_CPERROR|LOG_CPWARNING;
break;
case 3:
log_stderr = LOG_CPERROR|LOG_CPWARNING|LOG_CPDEBUG;
break;
default:
log_stderr = LOG_CPERROR|LOG_CPWARNING|LOG_CPDEBUG|LOG_CPINFO;
break;
}
if (run_tests) { if (run_tests) {
*exitcode = RunAllTests(); *exitcode = RunAllTests();
return 1; return 1;

View File

@ -910,7 +910,7 @@ void spawn_dragons(void)
equip_unit(u, get_equipment("monster_dragon")); equip_unit(u, get_equipment("monster_dragon"));
if (verbosity >= 2) { if (verbosity >= 2) {
log_printf("%d %s in %s.\n", u->number, log_printf(stdout, "%d %s in %s.\n", u->number,
LOC(default_locale, LOC(default_locale,
rc_name(u->race, u->number != 1)), regionname(r, NULL)); rc_name(u->race, u->number != 1)), regionname(r, NULL));
} }
@ -985,7 +985,7 @@ void spawn_undead(void)
name_unit(u); name_unit(u);
if (verbosity >= 2) { if (verbosity >= 2) {
log_printf("%d %s in %s.\n", u->number, log_printf(stdout, "%d %s in %s.\n", u->number,
LOC(default_locale, LOC(default_locale,
rc_name(u->race, u->number != 1)), regionname(r, NULL)); rc_name(u->race, u->number != 1)), regionname(r, NULL));
} }