Change Log File Name

Hello iarwain,
I think there is a bug in orx when we try to change the log file name.

Function _orxDebug_SetLogFile
/* Had a previous external name? */
  if((sstDebug.zLogFile != orxNULL) && (sstDebug.zLogFile != (orxSTRING)orxDEBUG_KZ_DEFAULT_LOG_FILE))
  {
    /* Closes it */
    fclose(sstDebug.pstLogFile);

    /* Deletes it */
    free(sstDebug.zLogFile);
  }
If we have a previous file name, it closes the file and releases the name string. But if we have not used the log until this point, the log file would not have been open. I think it is the same with _orxDebug_SetDebugFile.

If we call orxLOG before changing the file name, it works.

But then, when we call orxLOG again, now with the new file name, we have another problem.
Function _orxDebug_Log line 455
/* Needs to open the file? */
        if(sstDebug.pstLogFile == orxNULL)
        {
          /* Opens it */
          sstDebug.pstLogFile = fopen(sstDebug.zLogFile, "a+");
        }
The previous file was closed but sstDebug.pstLogFile is not NULL, so it does not open the new file.

I think this is all.

Comments

  • edited September 2012
    Hey thanks for the report, Peso.

    Would you mind also creating an issue here?

    Maybe a short description plus link to your post here?
    Trying to migrate slowly to better tracking as orx is getting bigger and bigger. :)

    Thanks in advance!

    Rom
  • edited September 2012
    iarwain,
    issue created. It was created as a major priority, sorry about that. I didn't see the priority selection, so the issue was created with the default one, which is major.

    Good to see things improving.
  • edited September 2012
    No worries!

    And the bug should have been fixed. :)
Sign In or Register to comment.