[AGS 3.6.1+] Using system.Log when debugging.

Started by Monsieur OUXX, Wed 17/07/2024 16:25:06

Previous topic - Next topic

Monsieur OUXX

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 :

Code: ags
[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.

 

Khris

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.

eri0o

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.

Crimson Wizard

#3
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.


SMF spam blocked by CleanTalk