You will find that after a while this doesn't really do the job. This has the charming property that it crashes the entire system. The trace class I provide allows for such features as limiting the number of lines of trace output, provides intelligent scrolling, provides a file save, and as a side benefit allows you to use multiple colors, for example to indicate errors in red, comments in green, data trace in blue, etc. The ultimate version of this is shown in the snapshot below. This is normally an invisible application, lurking in the tray of the toolbar.
Green messages are informational, red are errors, and blue are data transmission.
This class is reused in a large number of my applications. Therefore, it was worth spending some time to make it truly spiffy. Summary What you have here is a very mature debug log mechanism. While you may have slightly different needs that I did, this is a far better starting place than printf , cout , creating console windows, using edit controls, or just using a plain CListBox . The views expressed in these essays are those of the author, and in no way represent, nor are they endorsed by, Microsoft.