03 Apr 2015 @ 3:26 AM 

Somehow I’ve managed to never write about my Debug log class, looking through my post history.

It’s a versatile Debug Logging class that effectively hooks into and allows tracing of Trace.Write and Debug.Write method call output. I use it to redirect all Debug.Print() output to a text file for later examination. Some of my original considerations included being easy to use and add to existing software programs, as well as being able to do it’s job with as little interaction as possible. I’ve been able to use this successfully in it’s original program (BASeBlock) as well as inserting and using the class for Debug log functionality in software created and maintained as part of my Job, and it has worked wonderfully.

Example usage is straightforward- you enable logging by simply accessing the “EnableLogging” property; typically I set it to true for obvious reasons. The Static initializer of the class sets everything up from there:

And BAM! We’ve got a fully functional debug log- after the debug logs become a week old, they get purged, too! How is that for convenience?

Have something to say about this post? Comment!

Posted By: BC_Programming
Last Edit: 03 Apr 2015 @ 03:27 AM

Tags: ,
Categories: .NET, C#, Programming


Responses to this post » (None)


Sorry, but comments are closed. Check out another post and speak up!

Comment Meta:
RSS Feed for comments

 Last 50 Posts
Change Theme...
  • Users » 47469
  • Posts/Pages » 391
  • Comments » 105


    No Child Pages.

Windows optimization tips

    No Child Pages.

Soft. Picks

    No Child Pages.

VS Fixes

    No Child Pages.

PC Build 1: “FASTLORD”

    No Child Pages.