Board index » cppbuilder » event logging for runtime debug

event logging for runtime debug


2005-06-22 03:20:39 AM
cppbuilder74
Hello All,
I'm trying to make a generic logger for events, specifically for
entering and exiting my functions. Here's what I have so far...
// initialize GUI
void __fastcall TMyForm::FormCreate(TObject *Sender)
{
// log event
LogEvent(String("entering ") + Name + "::FormCreate()...");
// do something...
.
.
.
// log event
LogEvent(String("exiting ") + Name + "::FormCreate()...");
}
//---------------------------------------------------------------------------
I'd like to be able to log the names of the functions. These calls
generate log entries with the MyForm->Name in them automaticaly. Is
there a way to get the name of the function I'm currently inside?
Something like...
LogEvent(String("exiting ") + Name + "::" + FunctionName + "()...");
Thanks so much!
Rob
 
 

Re:event logging for runtime debug

Robert G. Hoover wrote:
Quote
I'd like to be able to log the names of the functions. These calls
generate log entries with the MyForm->Name in them automaticaly. Is
there a way to get the name of the function I'm currently inside?
Something like...

LogEvent(String("exiting ") + Name + "::" + FunctionName + "()...");
See "Predefined macros" in the TOOLS5.HLP
Specifically __FILE__ and __FUNC__
There are others as well.
 

Re:event logging for runtime debug

I did a complete search of my computer and no tools5.hlp exists. Nor
does tools5.hpp... can you provide additional assistance?
Thanks,
Rob
Bob Gonder wrote:
Quote
Robert G. Hoover wrote:


>I'd like to be able to log the names of the functions. These calls
>generate log entries with the MyForm->Name in them automaticaly. Is
>there a way to get the name of the function I'm currently inside?
>Something like...
>
>LogEvent(String("exiting ") + Name + "::" + FunctionName + "()...");


See "Predefined macros" in the TOOLS5.HLP
Specifically __FILE__ and __FUNC__
There are others as well.


 

{smallsort}

Re:event logging for runtime debug

Robert G. Hoover wrote:
Quote
I did a complete search of my computer and no tools5.hlp exists. Nor
does tools5.hpp... can you provide additional assistance?
Did I say that?
Must have been a typeo.
Try BCB5.hlp
Might be BCB6.hlp if you have 6.
If you downloaded the free commandline compiler, then you might need
to also download the help files which should be available at the same
location.
(btw, the real name for tools5 is bcb5tool.hlp, and is quite usefull)
 

Re:event logging for runtime debug

Found it! Thanks.... you're right, there's many a goodie in there!
Bob Gonder wrote:
Quote
Robert G. Hoover wrote:


>I did a complete search of my computer and no tools5.hlp exists. Nor
>does tools5.hpp... can you provide additional assistance?


Did I say that?
Must have been a typeo.
Try BCB5.hlp
Might be BCB6.hlp if you have 6.

If you downloaded the free commandline compiler, then you might need
to also download the help files which should be available at the same
location.

(btw, the real name for tools5 is bcb5tool.hlp, and is quite usefull)