Hi,
Why can't you write your log in levels. For example:
MyLog.Info('Entering method X');
Mylog.Debug(1, 'Connecting to database');
MyLog.Debug(2, 'Connected to database = '+FDatabase.ConnectionString );
And the constructor
Mylog := TMyLog.Create( 0 ); // No Debug information
Mylog := TMyLog.Create( 1 ); // Only Debug 1
Mylog := TMyLog.Create( 2 ); // Debug up to level 2.
This way you can activate debug using a INI file.
[Settings]
Debuglevel = 0; // Or 1 or 2
HTH,
Clément