Navigate your TRACE outputs






3.33/5 (6 votes)
Extended TRACE macros with easy source navigation
Introduction
XTrace replaces the standard MFC TRACE
macros. The macros implemented in XTrace.h add
the file name and the line number of the trace point to any trace message (using the built-in
__FILE__
and __LINE__
macros). A double click on the trace message in
the debug window navigates to the according source line.
Usage
- If you want to use standard MFC TRACEs and XTRACEs side-by-side:
- Add xtrace.cpp to your project.
- Include xtrace.h in stdafx.h.
- Use
TRACEx
for standard MFCTRACE
's andXTRACEx
for navigableTRACE
's.
- If you want to navigate all
TRACE
outputs:- Add xtrace.cpp to your project.
- Include xtracestd.h in stdafx.h. This will replace all standard MFC
TRACEx
macros withXTRACEx
macros.
Updates
2000-10-23
- Evaluation of vargs in
ExtTrace::Trace
fixed. - Macros are expanded to a single statement (using brackets and ',' operator).
- Newline will be appended to trace message if necessary.
- Macros renamed from
TRACE
toXTRACE
(to use simple MFCTRACE
's andXTRACE
's side-by-side). - Additional header xtracestd.h (include this header, if you want to replace all MFC
TRACE
macros with the accordingXTRACE
macros).