Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

TrackMethod logs LeaveMethod call prematurely


Code sample from main form constructor:

[code]__fastcall TMainForm::TMainForm(TComponent *Owner) :
SiMain->TrackMethod(lvDebug, this, L"TMainForm");

SiMain->LogVerbose(L"some message");

The log output in SI Console:

==> TMainForm.TMainForm
<== TMainForm.TMainForm
some message

Why is message “some message” logged after LeaveMethod log entry? Shouldn’t the log output look like this? Isnt the purpose of TrackMethod (in comparison to EnterMethod & LeaveMethod methods together with try finally construction) to simplify code instrumenting?

==> TMainForm.TMainForm
some message
<== TMainForm.TMainForm


Thanks for your posting. We haven’t seen this behavior before and the ordering should be different, yes. Do you only see this in constructors or also normal methods?