QsLogDisableForThisFile.h 680 B

12345678910111213141516171819202122
  1. #ifndef QSLOGDISABLEFORTHISFILE_H
  2. #define QSLOGDISABLEFORTHISFILE_H
  3. #include <QtDebug>
  4. // When included AFTER QsLog.h, this file will disable logging in that C++ file. When included
  5. // before, it will lead to compiler warnings or errors about macro redefinitions.
  6. #undef QLOG_TRACE
  7. #undef QLOG_DEBUG
  8. #undef QLOG_INFO
  9. #undef QLOG_WARN
  10. #undef QLOG_ERROR
  11. #undef QLOG_FATAL
  12. #define QLOG_TRACE() if (1) {} else qDebug()
  13. #define QLOG_DEBUG() if (1) {} else qDebug()
  14. #define QLOG_INFO() if (1) {} else qDebug()
  15. #define QLOG_WARN() if (1) {} else qDebug()
  16. #define QLOG_ERROR() if (1) {} else qDebug()
  17. #define QLOG_FATAL() if (1) {} else qDebug()
  18. #endif // QSLOGDISABLEFORTHISFILE_H