Results 1 to 3 of 3

Thread: Custom logging how to?

  1. #1
    Join Date
    Oct 2013
    Posts
    102
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Custom logging how to?

    Hi. My desktop gui app needs some kind of logging functionality, so that some actions which were triggered by the user will log (probably to a file). I need then to display these logs in the same app in a simple tabelar view. How would you do this? Are there any existing components available for similar purpose? Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Custom logging how to?

    There are lots of logging frameworks available for C++.

    Qt has one itself, though it does only have a subset of features, but the most common ones:
    http://doc.qt.io/qt-5/qloggingcategory.html

    I think it currenty can't log to a file itself, so one needs to install a Qt message handler to intercept the messages and write them to a file instead of stderr.

    If your view doesn't need to be updated on-the-fly I would simply load and display the log file.
    If it needs to, you probably need something more sophisticated.

    Cheers,
    _

  3. #3
    Join Date
    Oct 2013
    Posts
    102
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Custom logging how to?

    Thanks, will take a look.

Similar Threads

  1. QT Logging class
    By leoalvesmachado in forum Newbie
    Replies: 7
    Last Post: 1st December 2013, 20:30
  2. Qt used in well logging software
    By ecisp.wangshuo in forum Qt Programming
    Replies: 2
    Last Post: 20th July 2013, 09:19
  3. Replies: 0
    Last Post: 20th July 2013, 03:07
  4. Extending QTest for custom logging to TeamCity
    By bothapn in forum Qt Programming
    Replies: 4
    Last Post: 27th May 2011, 08:17
  5. logging support!!
    By Raajesh in forum Qt Programming
    Replies: 1
    Last Post: 18th June 2008, 19:18

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.