Aller au contenu

Photo

Debugging and Logging


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Rigortauri

Rigortauri
  • Members
  • 23 messages
I added some log_tracing/ channels to my script to debug them.

but they dont show in the log file.
I tried looking for some information on the wiki, but all i could find are the log_channels self, but now how to get them in the log.

i did create the ini file and put scrip to 1 , there is more info being inserted, but still not the channel stuff.

a simple PrintToLog() does not show up either

anyone care to explain how the channel logs can be accessed?

thnx

Modifié par Rigortauri, 27 novembre 2009 - 05:46 .


#2
Talian Kross

Talian Kross
  • Members
  • 239 messages
I asked this when the toolset was first released, but the developers chose to ignore my query.  (At the time, they were responding to almost every single thread being created, so yes, I use the term ignore literally. :) )

I suspect most of the "Debug_" functions have been compiled out, and that's normal: release build (what ships to us) vs. debug build.

That said, though, a log file is being generated each time we run the game: Documents/BioWare/Dragon Age/Logs/DragonAge_1.log.  It would be nice to know if we can access that log file via the scripting engine, or if it's strictly controlled by the game engine and therefore off-limits to us.

Here's hoping some developer responds.

UPDATE: Based on a post from Craig (link), I figured it out.

1.) If it doesn't exist--which is probably won't-create an empty text file named ECLog.ini in your (install dir)/bin_ship directory;
2.) In that configuration file, add the following:

[LogTypes]
Script=1

3.) Save and close the file.

Now, with that in place, just use PrintToLog() in your scripts to write entries to the above log file.

For example:

void DumpPartyList()
{
object[] arrPartyList;
int      nPartyListSize;
int      i;
string   szLogMsg;


    //  get all members in party
    arrPartyList   = GetPartyPoolList();
    nPartyListSize = GetArraySize( arrPartyList );
    
    PrintToLog( "****************************************" );
    PrintToLog( "****************************************" );
    PrintToLog( "****************************************" );
    for( i = 0; i < nPartyListSize; i++ )
    {
        szLogMsg = "[" + IntToString( i ) + "] " + GetName( arrPartyList[i] );
        PrintToLog( szLogMsg );
    }
    PrintToLog( "****************************************" );
    PrintToLog( "****************************************" );
    PrintToLog( "****************************************" );
}

Modifié par Talian Kross, 28 novembre 2009 - 07:02 .


#3
Innodil Ath Nathosh

Innodil Ath Nathosh
  • Members
  • 28 messages
Thanks, this was what I needed! :-)

#4
Rigortauri

Rigortauri
  • Members
  • 23 messages
thank, i indeed played around with the PrintToLog, getting atleast some debug info now.



but still hoping a dev can answer the channel question