qDebugWrapper.cpp 599 B

123456789101112131415161718192021222324252627
  1. #include "qDebugWrapper.h"
  2. #include <string>
  3. #include <sstream>
  4. #include <QDebug>
  5. void qPrint(const char* msg)
  6. {
  7. std::stringstream ss;
  8. ss << "Qt OpenAL Soft: " << msg;
  9. qDebug() << ss.str().c_str();
  10. }
  11. void qPrintEx(const char* file, unsigned short line, const char* msg)
  12. {
  13. std::string fullFilename(file);
  14. int ind = fullFilename.find_last_of("/") + 1;
  15. std::string filename = fullFilename.substr(ind);
  16. std::stringstream ss;
  17. ss << "Qt OpenAL Soft: " << filename.c_str() << ": " << line << ": " << msg;
  18. qDebug() << ss.str().c_str();
  19. }