Runtime Log Monitoring (h2)

From The Official Visionaire Studio: Adventure Game Engine Wiki
Name By
Runtime Log Monitoring (auto-update) AFRLme


This tip shows you how to setup real-time automatic log updates, so that you don't have to keep typing PRINT LOG into the developers console or opening & closing the messages.log file each time you want to check for new log messages, errors & warnings, which is extremely useful for developers working on scripting a new feature or debugging their games. This tutorial is for Windows. I'm sure there are some mac alternatives for Snaketail available. Essentially it's just an app that mirrors the -tail command for Linux machines.

I tried a few other apps including the silent update function of Notepad++, but none of the other programs wanted to run silently in the background. They needed the application window to be active (selected) in order to update the data retrieved from any linked log files, which wasn't much different to opening & closing the log files manually or using the print log command in the developer console.

Tutorial

1. First things first, you should make sure the log level for Visionaire Studio is set to info. To do this go to extras > options > player: set log level to info. The info setting will print out errors, warnings & messages generated by the print() command.

Rtlog 01.png


2a. Next you are going to need to download Snaketail from here. Snaketail is an open source app for windows that emulates the -tail command of Linux. In other words it will automatically update any txt / log files you open automatically on file change or after every x amount of time.

2b. Once you have downloaded & extracted or installed whichever version of Snaketail you need (x64, x86, portable), open it. Next we need to locate two files; one being the log file for the Visionaire Studio editor (viseditor.log) & the other being the log file associated with the project you are currently working on (messages.log). These two files will update you on various issues generated by the editor (development) or the player (runtime). Both files are located somewhere in c:/users/username/appdata/local/... Once done you will end up with 2 tabs.

To find the localAppDir where your projects save game files & log messages are stored, you should run your game through the editor. Press TAB on your keyboard to open up the developer console & then type: exec print( localAppDir ). Press enter, then type PRINT LOG, then press enter again to show the log. Navigate through the log pages using the PAGE UP & PAGE DOWN keys on your keyboard & look for a line containing something like c:/users/... & that will be where the localAppDir for your game is located.


Rtlog 02.png


3. To display both files at the same time you should use either: the Tile windows horizontally or the Tile windows vertically options found under the Windows menu. Once done you should have something like this...

Rtlog 03.png


4. Snaketail does not automatically remember the last session when you open it. The simplest method for getting it to remember the last session is to use Save session, load session & recent files in the File menu.

& that about covers it. If you want you can enable the always on top option in the file menu or adjust the refresh / changes interval values under Edit > View options > log file.


Resources

Name Description
Snaketail The application that we will be using to monitor the messages.log & viseditor.log files.