Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Monsieur OUXX on Wed 17/07/2024 16:25:06

Title: [AGS 3.6.1+] Using system.Log when debugging.
Post by: Monsieur OUXX on Wed 17/07/2024 16:25:06
I fail to find the absolute simplest way of using method System.Log.
From what I understand (here : https://adventuregamestudio.github.io/ags-manual/EngineConfigFile.html   and here: https://adventuregamestudio.github.io/ags-manual/RuntimeEngine.html#command-line ) one has to add a command line switch.

Is there a way of simply enabling the logging from running the game in Debug, from the Editor?

I tried adding this to acsetup.cfg in the _Debug folder :

[log]
file=all:all
file-path=C:\Users\admin\repos\ags-essential-modules\AGS 4 essential modules\_Debug\log.txt

Unfortunately the file gets reset every time I run the game.

I tried with acsetup.cfg from folder \Compiled\Windows and \Compiled\Data,. those don't get overwritten but do nothing.

Title: Re: [AGS 3.6.1+] Using system.Log when debugging.
Post by: Khris on Wed 17/07/2024 22:29:47
The page you linked to mentions the two places where you can put the acsetup.cfg containing the [log] lines:

user's global config: %USERPROFILE%/Saved Games/Adventure Game Studio/acsetup.cfg
user's game config: %USERPROFILE%/Saved Games/GAMENAME/acsetup.cfg

I tried the global config and it worked on the sport.
Title: Re: [AGS 3.6.1+] Using system.Log when debugging.
Post by: eri0o on Thu 18/07/2024 00:18:01
In theory if you are running it on the debug you just read the debug log in the Editor pane. The editor log pane has also a way to configure the log level.
Title: Re: [AGS 3.6.1+] Using system.Log when debugging.
Post by: Crimson Wizard on Wed 24/07/2024 16:54:35
The absolute simpliest way is to use the "Log Panel" in the Editor that eri0o mentioned, it may be made visible in "Windows" menu.
https://adventuregamestudio.github.io/ags-manual/EditorLogPanel.html
(unfortunately the help page does not tell about the menu command)

About acsetup, global config is the fastest way perhaps, but if you require an individual approach per game, then adding acsetup.cfg file to the project root folder will make it merged with the one that Editor generates.

Note that you don't have to put "file-path" unless you really want that, the default log path is "%USERPROFILE%/Saved Games/Adventure Game Studio/ags.log"

I suppose that we may discuss some better way of configuring this log file setting from the Editor itself.