Has anyone used "TraceFiles" in ABCFILE to help diagnose problems?

Are there any tricks to it?

Actually all I really want to do is log all open/close and specify which procedure (GlobalErrors.GetProcedureName()) it was that called the open/close. I think the only real way to do this is to derive the FileManager but I was hoping for a shortcut :slight_smile:

Ok, so I derived the FileManager :slight_smile:

In case it is helpful to anyone else, or if anyone has any suggestiongs/comments, this is what I did:

MyFileManager.inc

!ABCIncludeFile(ABC)

  INCLUDE('Debuger.inc'),ONCE
  INCLUDE('ABFILE.INC'),ONCE
  INCLUDE('ABERROR.INC'),ONCE

MyFileManager      Class(FileManager),Type,Module('MyFileManager.Clw'),LINK('MyFileManager.Clw',_ABCLinkMode_),DLL(_ABCDllMode_)
DB                              &Debuger
Open                            PROCEDURE() ,BYTE,PROC,VIRTUAL
Destruct                        PROCEDURE() ,VIRTUAL
                   END

MyFileManager.clw

  MEMBER
  INCLUDE('MyFileManager.inc'),ONCE

MyFileManager.Open                            PROCEDURE()!,BYTE,PROC,VIRTUAL
  CODE
  IF SELF.DB &= NULL
    SELF.DB &= New(Debuger)
    SELF.DB.DebugActive = TRUE
  END
  SELF.DB.Message('Open Called From: ' & SELF.Errors.GetProcedureName(), SELF.GetName())
  RETURN PARENT.Open()

MyFileManager.Destruct               PROCEDURE ()! ,VIRTUAL 
  CODE
  Dispose(SELF.DB)

Since I am only planning to swap in this derived FM when I need to debug something during development I figured that SELF.DB.DebugActive = TRUE would work well enough. You could certainly take this further and have it more runtime configurable, log to file, etc, etc.