I have compiled the code from svn repository with debug enabled:
./autogen.sh --enable-debug
make
Now I can see the level 4 debug messages by launching the server this way:
./fcser --debug 4
How can I see only the specific log messages related to the file aihand.c, for example?
I tryed this, but I see no logs:
./fcser --debug 4:aihand.c
I'd like to see the log messages generated by this code inside aihand.c (or similar ones):
log_base(LOGLEVEL_TAX, "%s [res] balanced! (Sci/Lux/Tax)>=%d/%d/%d",
player_name(pplayer), rates[AI_RATE_SCI],
rates[AI_RATE_LUX], rates[AI_RATE_TAX]);
how to see debug messages?
Re: how to see debug messages?
I still don't know the answer to the previous question, I change the debug level in the file.c as a workaround...
Another related question.
I use ./fcser to launch the game from the source folder (after make, without make install).
But savegames are created in the main freeciv folder (where fcser script is placed), and rulesets are not loaded from my home/.freeciv folder.
I have tried to change the env variables FREECIV_PATH, and FREECIV_SAVE_PATH, for example:
I have been able to load rulesets from my home/.freeciv/dev folder this way, but savegames keep being saved in the source folder.
Do you know how to change the save folder without installing the game? (I'm using kubuntu 13.10)
Another related question.
I use ./fcser to launch the game from the source folder (after make, without make install).
But savegames are created in the main freeciv folder (where fcser script is placed), and rulesets are not loaded from my home/.freeciv folder.
I have tried to change the env variables FREECIV_PATH, and FREECIV_SAVE_PATH, for example:
Code: Select all
FREECIV_PATH="~/.freeciv/dev"; export FREECIV_PATH
Code: Select all
FREECIV_SAVE_PATH="~/.freeciv/saves"; export FREECIV_SAVE_PATH
Do you know how to change the save folder without installing the game? (I'm using kubuntu 13.10)
Re: how to see debug messages?
FWIW, I don't know either, and I haven't investigated.bard wrote:I still don't know the answer to the previous question, I change the debug level in the file.c as a workaround...
FREECIV_SAVE_PATH only affects where save files are read from. The only way to change where they are written to (apart from changing the working directory) is via the --saves option to freeciv-server. (The man page could be clearer about this, now I come to read it.)bard wrote:I use ./fcser to launch the game from the source folder (after make, without make install).
But savegames are created in the main freeciv folder (where fcser script is placed), and rulesets are not loaded from my home/.freeciv folder.
I have tried to change the env variables FREECIV_PATH, and FREECIV_SAVE_PATH, for example:Code: Select all
FREECIV_PATH="~/.freeciv/dev"; export FREECIV_PATH
Code: Select all
FREECIV_SAVE_PATH="~/.freeciv/saves"; export FREECIV_SAVE_PATH
Re: how to see debug messages?
Thanks, this "--saves" option is exactly what I was looking for
I'm starting to contribute with some minor patches or fixes, and I feel there are some things about debugging freeciv code that I still need to learn, like the way to see the log messages related to AI thinking. But maybe I chose a wrong example for my question.
I remember cazfi told me to use this option --debug 4:file.c in order to see only the log messages of certain files, but it does not work as I expected.
And I have seen this server option: debug - Turn on or off AI debugging of given entity. But it always return "invalid argument" when I try it, for example:
JTN, when you debug or test patches, how do you make to watch the log messages from the ai code?
I'm starting to contribute with some minor patches or fixes, and I feel there are some things about debugging freeciv code that I still need to learn, like the way to see the log messages related to AI thinking. But maybe I chose a wrong example for my question.
I remember cazfi told me to use this option --debug 4:file.c in order to see only the log messages of certain files, but it does not work as I expected.
And I have seen this server option: debug - Turn on or off AI debugging of given entity. But it always return "invalid argument" when I try it, for example:
Code: Select all
/debug player Caesar