bluetiger9 / SmtpClient-for-Qt

An SMTP Client writen in C++ for Qt. Allows applications to send emails (MIME with text, html, attachments, inline files, etc.) via SMTP. Supports SSL and SMTP authentication.
https://github.com/bluetiger9/SmtpClient-for-Qt/wiki
GNU Lesser General Public License v2.1
456 stars 227 forks source link

Need to disable debug output using seperate flag #159

Closed ocgltd closed 2 months ago

ocgltd commented 4 months ago

At the moment the code sends output to stderr based on the compiler QT_NO_DEBUG flag. There should be a separate compiler flag, or even better a runtime variable to enable/disable debugging. We should not use QT_NO_DEBUG since it fills stderr with unnecessary text when debugging something else in the overall program.

e.g.

#ifndef QT_NO_DEBUG
        qDebug() << "[Socket] OUT:";
        qDebug() << email->toString();
#endif
bluetiger9 commented 2 months ago

Hi @ocgltd! :slightly_smiling_face:

I would suggest to use the Release version of the library even for Debug builds of your application. The current debug functionality is indented to investigate bugs in the library. It is not really for debugging runtime issues with certain mail servers.

We could add the runtime flag for logging the network traffic, but unfortunately I don't really have the bandwidth to implement it. If you have the time, please feel free to create a PR.

Thanks!