static void ARX_GLAPIENTRY callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * message, const void * userParam) { ARX_UNUSED(length); ARX_UNUSED(userParam); std::ostringstream buffer; const GLchar * end = message + std::strlen(message); while(end != message && (*(end - 1) == '\r' || *(end - 1) == '\n')) { end--; } buffer << sourceToString(source) << " " << typeToString(type) << " #"<< id << ": "; buffer.write(message, end - message); switch(severity) { case GL_DEBUG_SEVERITY_HIGH_ARB: LogError << buffer.str(); break; case GL_DEBUG_SEVERITY_MEDIUM_ARB: LogWarning << buffer.str(); break; case GL_DEBUG_SEVERITY_LOW_ARB: LogInfo << buffer.str(); break; default: break; } }
void RenderingDebugOutput::addToQueue( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message) { if (severity < m_minimumSeverityLevel) return; std::stringstream errorString; errorString << "Debug Message:" << "\n\t Source: " << sourceToString(source) << "\n\t Type: " << typeToString(type) << "\n\t Severity: " << severityToString(severity) << "\n\t ID: " << id << "\n\t Message: " << message << "\n"; if (m_multithreaded) { std::lock_guard<std::mutex> lock(m_mutex); m_log.push_back(std::move(errorString.str())); } else { m_func(errorString.str()); } }
QDebug operator<<(QDebug dbg, const CoverInfo& info) { return dbg.maybeSpace() << QString("CoverInfo(%1,%2,%3,%4,%5,%6)") .arg(typeToString(info.type)) .arg(sourceToString(info.source)) .arg(info.coverLocation) .arg(QString::number(info.hash)) .arg(info.trackLocation); }