Forum Discussion

gus's avatar
gus
Contributor
9 years ago

Message posted to wrong log folder

Hi,   I'm completely clueless what this strange behavior is posted by: I append a log folder to the one on the top of the folder stack, but TC only posts entries to this appended folder only when e...
  • joseph_michaud's avatar
    9 years ago

    A simple test shows that calling Log.PushFolder() on the same folder twice does actually push that folder twice onto the stack.  Popping it off twice is appropriate.  (attached the foldertest that I used)

     

    I can reproduce your problem only if I push an invalid folder ID:

     

    function ReadGlobalConfig()
    {
      var GetInfrastructuralLogID = Log.CreateFolder("GetInfrastructuralLog", null, pmLowest);
      Log.PushLogFolder(GetInfrastructuralLogID);
      
      var logId = Log.AppendFolder("Reading project suite configuration settings");
    var invalidID = 5;
    Log.PushLogFolder(invalidID);
      
      Log.Message("Method 1", null, pmLowest);
      Log.Message("Method 2", "", pmLowest, null, null, logId);
      Log.Message("Method 1", null, pmLowest);
      
      Log.PopLogFolder();
      Log.PopLogFolder(); // Infra log
    }

     

    Other than that, I've got nothing.