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. Is it ok to leave the debugging messages once a program is ready to be released
Forum Updated to NodeBB v4.3 + New Features

Is it ok to leave the debugging messages once a program is ready to be released

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.4k 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.
  • F Offline
    F Offline
    fs_tigre
    wrote on last edited by
    #1

    Hi,

    Is it ok to leave the debugging messages in your final program or they need to be deleted once the programs is released for distribution?

    What do you guys do?

    Does leaving the debugging messages causes any issues?

    I usually delete them but I want to hear from the experts because if this doesn't have any impact on the performance I would rather leave them.

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You seem to have a copy/paste issue…

      It all depends on the messages. Messages that are only there to debug/understand what the code does should be removed (even before release). However you can have other class of messages that can show misbehavior/exceptional conditions/failures etc… You should keep them maybe even offer the possibility to log them so users can send you the logs/reports when your application is crashing.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vidar
        wrote on last edited by
        #3

        If you log the debug messages with qDebug() << xy you can avoid the logging by defining "QT_NO_DEBUG_OUTPUT" in your project file for the Release build.
        I think that the Define will avoid the actual compilation of the qDebug calls and therefore leaving the qDebug lines in the code will not affect the performance in the Release build.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fs_tigre
          wrote on last edited by
          #4

          Thank you for your replies.

          These logs are strictly for debugging purposes while in development to understand what the code is doing/outputting.

          It looks like it would be better to remove them. I will try “QT_NO_DEBUG_OUTPUT”

          Thanks a lot

          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