Friday, May 18, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: rich text box and scroll
Prev Next
You are not authorized to post a reply.

Author Messages
Graham Walsh

06/24/2008 9:13 AM  

Hi Hi,

 

Whats the simplest way to make the content of the rich text box “selectable”. We have an awful lot of log output going to that window, all of which is needed. Ideally I’d like to freeze the window, select the text and have the RTPappender continue its writing. By default I’d temporarily set the RTB enabled == false, select the text and then set it back to true but that seems a bit luggish.

 

Any tips?

 

Thanks

 

Graham

 

James Katz

06/24/2008 3:10 PM  
You will want to make the text of the RTB follow the tail of the log.  In-core storage of text is VERY co$tly. If you're using a C# or Java RTB, you assign its Text property the whole string you want.  You generally can't just add the newest line to the existing text.  Also the += implementation for strings in those 2 languages are wicked expensive.
 
So given that you will have to pause and recalculate the contents of the text box when some number 'n' of new lines comes in, you will have to store the total lines somewhere else anyway.  but that's a side issue.
 
 you ought to have the RTB enabled, but explicitly trap the MouseDown event in the box.  When you do that, you can start the selection process (handling the mousemove and mouse up events).  Since most window controls are single threaded, that in and of itself will stop the process of appending text to the window, until you've finished processing the mouseup event.
 
Since you're capturing a mousedown event, you control all the interaction - all you have to do is disregard key events to keep people from typing into the text - the only allowable action is to mousemove until mouseup.  That way, you can keep the RTB enabled.
 
HTH,
 
Jim
 
Graham Walsh

07/01/2008 9:13 AM  
thanks James,
 
I'll code that up. Helped a lot :)
 
 
G

 

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > rich text box and scroll



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement