News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

120.2.3 Nightly Linux pak192.comic.0.4.1 - debug level 5 disables debug messages

Started by userfriendly, November 17, 2017, 05:18:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

userfriendly

Not sure if this is a bug, but the help output of sim -h indicates the debug can be between 1 and 5 and setting it to 5 doesn't actually print debug messages.
Execution arguments are: -async -debug 5 -use_hw -screensize 1200x700 -lang en -objects pak192.comic.0.4.1 -nosound -nomidi -load save1.sve.
Debug messages, such as
dbg->debug("tool_t::read_menu()", "creating %s", id);
are not logged. Looking at log.cc:85:    if(log_debug  &&  debuglevel==4) {, it seems only debug level 4 will allow printing.

Sorry if this has been reported or is not really a bug. Maybe it's just the help text or I didn't read some documentation?
Just be good to each other.

Ters

The help text can perhaps be read that (1..5) is an open interval, meaning that 1 and 5 are themselves not included. I don't think that is intended, though. The code very much treats 1 as a valid log level. In fact, it even appears that 0 is a valid level.

Another oddity in the logging is that vmessage is not a variant of message, but of error, since it checks for debuglevel>0 not debuglevel>2

userfriendly

Just be good to each other.

prissi

In r8410 the debug levels are now defined as intended, i.e. >=level. Currently there are level 0 (nothing) 1 (error) 2(error+warning) 3(error+warnings+messages) and 4 (all messages).