Removing debug messages

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

Removing debug messages

Post by silene »

As a quick experiment, I launched a 40-turn with 2 players game. Wesnoth spat around 75000 lines of messages (3MB of data); and it was without having activated the debug option!

That's definitely too much. And it considerably slows down the game (std::cerr outputs are not buffered). Redirecting standard error toward /dev/null is not a solution since it would also destroy useful error messages.

So I intend to remove all the debug messages that are not controlled by the debug option. I will not touch error/warning messages (since they are the interesting ones). As an example, "setting mode to 832x624x16" is a useful debug message, "Wrapping word Horse based units are generally resistant to attacks with bladed or impact weapons, but are vulnerable to attacks with piercing weapons, including bows and spears." is not!

The purpose of this thread is for Wesnoth developers to tell me which debug messages they still need at the moment. The other messages will be destroyed (or at least commented out) in a few days.
Herkum
Posts: 54
Joined: September 18th, 2004, 2:14 am

Error Message Classifications

Post by Herkum »

Instead of removing select error messages maybe they should be broken down into classes and then let people select what classes of errors they would like to see.

It would keep you from removing an error that maybe someone was interested in looking at.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

or you could just output the errors to a file. This would (dave says) speed it up and allow for better debugging if there is a problem.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

Post by silene »

Since it seems some users were interested, I will explain which mechanism has been added to Wesnoth CVS and will be present in the 0.8.5 version. Please note that it is only partly effective for the moment since there are hundreds of place that dump silly things in the logs and they all need to be converted to the new system.

There are three severity levels (error, warning and info) and a few debug domains (ai, display, engine, network, ...). By default, only error messages are displayed. But by passing some command-line options it is possible to set the verbosity of each debug domain.

For example,

Code: Select all

wesnoth --log-warning=all --log-info=ai,engine
will dump all error and warning messages, and all debug messages related to the AI player and the A* pathfinding algorithm (and a few other messages located in the 'ai' and 'engine' debug domains).
Post Reply