ILoggable

A place to keep my thoughts on programming

 Subscribe

geekblog
[at]
claassen [dot] net

Powered by Blogger

Monday, June 06, 2005

Revised DebugLog window

Ran into problems with the debuglog window code i posted. Basically, since the log watcher thread is not the form's thread, you can run into deadlock. So i created a fully self-contained floating window, that properly manages the log writing using Invoke(). For more detail on the whole Form thread vs. other threads issue, check out this Code Project article.

The .cs and .resx files are here

Update 6/12/05: Fixed another deadlock issue with the Debug window. See this post for details. The linked source was updated.

1 Comments:

At 8:54 AM, Blogger brett said...

You can easily make the Logger use a layout engine by replace the following line.

//builder.Append(ev.LoggerName + ": " + v.RenderedMessage+"\r\n");
builder.Append(logger.Layout.Format(ev));

And setting up a layout in the constructor.
PatternLayout patternLayout = new PatternLayout();
patternLayout.ConversionPattern = "%-5p [%c{1}]: %m%n";
patternLayout.ActivateOptions();
logger.Layout = patternLayout;

 

Post a Comment

<< Home