Original Post
I already use my own design of Logger class for all my logging requirements during debugging. In the past I have made it dependant on an ''#ifdef _DEBUG'' system to have it removed in the Release build (I know, there are better ways than #ifdef''s scattered through the code).
What I really would like though is to be able to leave it in, but only have it active in special circumstances (not decided yet, but maybe via a -debug command-line, holding Shift on Program start-up to get an Advanced Configuration page, adding a Debug=1 line to a CFG file, or something similar). The idea is that when a user has a problem with the software, Tech Support can tell them how to activate Logging/Reporting (maybe for a particular section eg Video), and the resulting file is sent to Tech Support. On the flip-side though, I don''t want to lose a lot of cycles each time testing an internal ''bool _Logging'' flag just to see if I should write out via the Logger class.
Is there a good way for still keeping the ability in the program, but not inefficiently checking the Logging state at every place where data would be written out if Logging was on?
On a similar note, a lot of modern programs generate an error report (call-stack etc) when there is a problem. How do you get call-stack data from Windows?
Yours,
Archimage
(Ann-Marie Ratcliffe)