Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] How to show Qt debug messages outside the debugger

[Solved] How to show Qt debug messages outside the debugger

Scheduled Pinned Locked Moved General and Desktop
22 Posts 11 Posters 47.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    giesbert
    wrote on last edited by
    #10

    I looked a bit for information about this topic:
    "Here som general things about debugging (also to Mac)":http://doc.qt.nokia.com/4.7/debug.html

    bq. The Qt implementation of these functions prints the text to the stderr output under Unix/X11 and Mac OS X. With Windows, if it is a console application, the text is sent to console; otherwise, it is sent to the debugger. You can take over these functions by installing a message handler using qInstallMsgHandler().

    So it also shows a way you can go to use "custom message handlers":http://doc.qt.nokia.com/4.7/qtglobal.html#qInstallMsgHandler

    Nokia Certified Qt Specialist.
    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #11

      On Mac OS X the debug output goes to the system logger. You can read it with the Console Application (Usually in /Applications/Utilities/Console.app).

      For your own logging facilities "qInstallMsgHandler()":http://doc.qt.nokia.com/latest/qtglobal.html#qInstallMsgHandler is your friend (that's the solution Gerolf mentioned).

      I once wrote a small GUI that collects the qXXX() messages. I can put it in the wiki on request.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kamalakshantv
        wrote on last edited by
        #12

        You can get some help using qInstallMsgHandler() from "this":http://lists.trolltech.com/qt-interest/2006-05/msg00602.html thread too.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #13

          QxtLogger can install itself the hander for Qt's debug messages as well, and you can use several outputs for your logging info. StdErr/StdOut of course, but also files in different formats.

          The qt += console suggestion given earlier only works on windows.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            d.oberkofler
            wrote on last edited by
            #14

            [quote author="Volker" date="1293097794"]On Mac OS X the debug output goes to the system logger. You can read it with the Console Application (Usually in /Applications/Utilities/Console.app).

            For your own logging facilities "qInstallMsgHandler()":http://doc.qt.nokia.com/latest/qtglobal.html#qInstallMsgHandler is your friend (that's the solution Gerolf mentioned).

            I once wrote a small GUI that collects the qXXX() messages. I can put it in the wiki on request.[/quote]

            I think it would be great if you could make your "small GUI that collects the qXXX() messages" available to everyone.

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vcsala
              wrote on last edited by
              #15

              @Volker, that would be really nice of you.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kamalakshantv
                wrote on last edited by
                #16

                [quote author="Volker" date="1293097794"]On Mac OS X the debug output goes to the system logger. You can read it with the Console Application (Usually in /Applications/Utilities/Console.app).

                For your own logging facilities "qInstallMsgHandler()":http://doc.qt.nokia.com/latest/qtglobal.html#qInstallMsgHandler is your friend (that's the solution Gerolf mentioned).

                I once wrote a small GUI that collects the qXXX() messages. I can put it in the wiki on request.[/quote]

                Yes, everyone would like such a handy tool.

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  giesbert
                  wrote on last edited by
                  #17

                  Request :-))

                  Nokia Certified Qt Specialist.
                  Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #18

                    I've added a "wiki page":http://developer.qt.nokia.com/wiki/Browser_for_QDebug_output with the source code of the QDebug Log Output Browser.

                    I hope it is useful for somebody and of course feel free to ask, if you have questions.

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      ashwindas
                      wrote on last edited by
                      #19

                      Thanks Volker, I was also looking for something similar :)

                      1 Reply Last reply
                      0
                      • U Offline
                        U Offline
                        ucomesdag
                        wrote on last edited by
                        #20

                        [quote author="Volker" date="1294011522"]I've added a "wiki page":http://developer.qt.nokia.com/wiki/Browser_for_QDebug_output with the source code of the QDebug Log Output Browser.[/quote]

                        Thanks Volker, fiddling with it at the moment... :-)

                        Write “Qt”, not “QT” (QuickTime).

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          goetz
                          wrote on last edited by
                          #21

                          I added the .pro file, that was missing from the first version.

                          http://www.catb.org/~esr/faqs/smart-questions.html

                          1 Reply Last reply
                          0
                          • D Offline
                            D Offline
                            d.oberkofler
                            wrote on last edited by
                            #22

                            [quote author="Volker" date="1294011522"]I've added a "wiki page":http://developer.qt.nokia.com/wiki/Browser_for_QDebug_output with the source code of the QDebug Log Output Browser.
                            I hope it is useful for somebody and of course feel free to ask, if you have questions.[/quote]
                            Thank you!

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved