So the Debug build works great, but the Release build crashes? Or the program works fine on your computer, but crashes on the customer's computers? You need to add trace functionality to the Release build.
CLogTrace is a class that allows you to easily add trace functionality to the release build of a program. You make the program write lines of text to a log file at various stages in the program. You provide the code to turn the logging on or off. Much like using the TRACE macro, you get a text file that tells you what functions were called, with a date/time stamp. Except you can get this information in release builds.
The class is easy to use.
- Make a static CLogTrace object as a member of the application class
- Add the initialization lines in the programs InitInstance function.
- Any time you want to write to the log file, use the CLogTrace::WriteLine functions these will write the text along with date and time
Комментариев нет:
Отправить комментарий