Results 1 to 2 of 2

Thread: Implementing a better (faster) logging console

  1. #1
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    131
    Thanks
    11
    Thanked 16 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Smile Implementing a better (faster) logging console

    According to my previous post I am having problems with a small logging console, that was not fast enough. So I decided to redesign it according to your tips.

    I setup a small project in Qt Creator (first time using it ) and put it on my github account

    Its just a QMainWindow with a start/stop button and a button to enable or disable the highlighting an a small lpm (lines per minute) counter. The Performance is really good (in comparison to my old console). Its not finished, but I feel I am on the right path. If your like look at it and post me your comments (interesting are only two small classes - not much to read)

    Greetings
    nightghost
    Attached Images Attached Images

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Implementing a better (faster) logging console

    It is likely that you will want to be able to log without interrupting the operation too much. You might be interested in queuing the data to be written. Copying a QString is a constant time operation, writing the data to screen probably isn't.

    You might want to look into thread safety when you got the basics going and you are happy with the progress.

    Reading from stdout/stdin/QProcess is probably safe enough at this point.

    Other than that, you can consider using the QtTestLib to test and benchmark your code. This will help you identify the most time intensive operation in your application. You might be able to optimize even more.

    Hint: start with the test. Test driven development is really good for your productivity. The stuff I wrote above is untested and I can give no guarantee that it will actually help improve your code. A proper unit test will, though.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. Logging Qt User Actions
    By Frank J. Lhota in forum Qt Programming
    Replies: 14
    Last Post: 30th May 2014, 21:36
  2. logging support!!
    By Raajesh in forum Qt Programming
    Replies: 1
    Last Post: 18th June 2008, 19:18
  3. Cross Platform Logging
    By skyphyr in forum Qt Programming
    Replies: 2
    Last Post: 23rd November 2006, 16:32
  4. logging and tracing in Qt
    By Artschi in forum Qt Programming
    Replies: 4
    Last Post: 17th January 2006, 20:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.