Creating an allegro.log (for debugging purposes)

Started by Forestidia86, March 22, 2024, 07:08:51 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Forestidia86

Edit: First option - building with debugging libraries

Only a first draft:

Options to get the Allegro debugging libs and dlls are nuget package or (mingw) release from the github page of Allegro 5.
From my experience: Running after building with the nuget release ones would need as extra dependencies Microsoft building tools (debugging variants of standard dlls, not tested since no access to these tools). Whereas the github release needs mingw libraries (which have a better availability).

For the dlls just choose the ones with 'debug' in the name.
For libs I know no other way than to rename them. (This means you can't have non-debug and debug libs at the same time in your toolchain.)
For nuget you already have lib-files and you have to choose the ones with 'debug' in the name. But for using them I had to remove the '-debug' part of the name, so that they look like the non-debug ones.
For the github release there are no libs. (For build with optlink you can use implib to create some.) As one way to get files that work like libs, you can rename the liballegro_....dll.a to lib files. Again you have to choose the ones with debug in their name but rename them without the '-debug' so that they look like the regular lib files, e.g. 'liballegro-debug.dll.a' to 'allegro.lib' or 'liballegro_acodec-debug.dll.a' to 'allegro_acodec.lib'.
There are maybe/probably more elegant ways to achieve this but this is how it worked for me.

Building is as usual.

If building with Allegro debug libraries was successful there should be an allegro.log (gets huge fast) created after starting the game.

Forestidia86

#1
Second option - allegro5.cfg

You can also create an allegro.log by modifying the allegro5.cfg and putting it in the same folder as the Lix executable. (This works even with release DLLs, i.e., with the DLLs that Simon offers in the main download. You don't need debug DLLs.)

allegro5.cfg can be found in the allegro5 github repo. Below [trace], which is in line 193 as of January 2025, set the trace level (level=) to one of the following lines:

level=debug   ... to get all the information, but this will produce a huge logfile,
level=info   ... to get lots of info, but not everything; this is a good level,
level=warn   ... to get errors and some extra information,
level=error   ... to get errors only.

Save this allegro5.cfg in the save folder where lix.exe is. Then run Lix as normal. After playing, you'll find allegro.log in the same folder. You can read it with any text editor.

(Simon restructured/edited this post for better readability/information.)