Article View: borland.public.cppbuilder.nativeapi
Article #5945event logging for runtime debug
From: Robert G. Hoover
Date: Tue, 21 Jun 2005 19:20
Date: Tue, 21 Jun 2005 19:20
32 lines
1732 bytes
1732 bytes
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
Technical Details
Message-ID:
<42b86886$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,848a19c84e55796,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 21 Jun 2005 15:20:39 -0400 From: "Robert G. Hoover" <not.a.real.address@anywhere.sorry> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: event logging for runtime debug Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 68.48.159.204 Message-ID: <42b86886$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1119381638 68.48.159.204 (21 Jun 2005 12:20:38 -0700) Lines: 32 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail