Game Development Community

Console.log default name

by Arcanor · in Torsion · 12/04/2007 (5:50 am) · 5 replies

I've installed a TGEA engine mod which allows me to change the console logfile name to be something other than the default "console.log". It works great when I run TGEA directly, but when I run from inside Torsion it appears that Torsion is creating the console.log file all by itself, and sticking in all the pre-compile stuff. I guess this is because I haven't told Torsion about the new logfile name. Is it possible to inform Torsion of this somehow, so it doesn't cause a split of my logfile?

i.e. instead of this:

console.log - contains script pre-compile info
newlogfilename.log - contains the rest of the program output

I'd like to see this:

newlogfilename.log - contains everything

#1
12/04/2007 (9:44 am)
Torsion's precompile step uses your executable and the script file located in C:\Program Files\Torsion\torsion_precompile.cs
#2
12/04/2007 (11:21 am)
First off Torsion never creates the console.log file. It does however request that the engine start logging in the torsion_precompile.cs as James said:

// Start the console logger in a "open, write, close" mode.
setLogMode( 1 );

I assume here that the TGEA mod you installed allows you to change the log file name from script. The problem with this is Torsion will still be looking for console.log. I'll see if maybe i can add the log file name as an option for a future Torsion release.
#3
12/04/2007 (11:27 am)
I'm pretty sure the precompile console.log gets overwritten when you start debugging too, not appended (at least as default behavior of TGE/TGB)
#4
12/04/2007 (12:14 pm)
Thanks for your replies guys. This isn't a huge priority, obviously, just a "nice to have" so that my logfile will be all in one piece again.

For your reference, this is the resource I used to change the logfile name: www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4861

One thing I don't understand though. I've changed the default filename from "console.log" to "console2.log" in C++ code (in console.cpp), and I'm changing the filename in script using the resource's new function "setLogFileName("console3.log")". When I search the solution for the string "console.log" I find no references. Yet somehow when I run the application I'm getting THREE logfiles. As soon as I start the application (from inside Torsion) both "console.log" (empty file) and "console2.log" (contains precompile info) are created. Then shortly after this, "console3.log" is created (contains the game runtime output).

I understand that "console2.log" is being created early in the startup process because the engine hasn't parsed my scripts yet, but where is the empty "console.log" file coming from?
#5
12/04/2007 (12:17 pm)
Hum... maybe i do create the console.log... but i don't remember doing that. I'll take a peek at the code and report back.