18#include <QtCore/qdebug.h>
19#include <QtCore/qloggingcategory.h>
20#include <QtCore/qthread.h>
28#define qOhosDebug(category)
29 _Pragma("GCC diagnostic push")
30 _Pragma("GCC diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"")
32 _Pragma("GCC diagnostic pop")
34#define qOhosWarning(category)
35 _Pragma("GCC diagnostic push")
36 _Pragma("GCC diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"")
38 _Pragma("GCC diagnostic pop")
40#define qOhosCritical(category)
41 _Pragma("GCC diagnostic push")
42 _Pragma("GCC diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"")
44 _Pragma("GCC diagnostic pop")
46#define qOhosFatal(category)
47 _Pragma("GCC diagnostic push")
48 _Pragma("GCC diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"")
50 _Pragma("GCC diagnostic pop")
60 qOhosVPrintf(LOG_DEBUG, format, ap);
68 qOhosVPrintf(LOG_INFO, format, ap);
76 qOhosVPrintf(LOG_WARN, format, ap);
84 qOhosVPrintf(LOG_ERROR, format, ap);
88template<
typename StringType>
93 {
qOhosDebug(QtForOhos) <<
"T:" << QThread::currentThreadId() <<
", M:" << message <<
"begin";}
101template<
typename StringType>
104 QCScopedDebugJS(StringType message): m_message(message) {qOhosPrintfDebug(
"%s begin", message);}
108 StringType m_message;
111template<
typename StringType>
112auto make_QCScopedDebug(StringType&& message) -> QCScopedDebug<
typename std::decay<StringType>::type> {
113 return {std::forward<StringType>(message)};
116template<
typename StringType>
117auto make_QCScopedDebugJS(StringType&& message) -> QCScopedDebugJS<
typename std::decay<StringType>::type> {
118 return {std::forward<StringType>(message)};
121#define DUMP(x) qOhosDebug(QtForOhos) << "T:" << QThread::currentThreadId() << #x << x;
void qOhosLogMessage(LogLevel logLevel, const char *tag, const char *message)
void qOhosVPrintf(LogLevel logLevel, const char *format, std::va_list ap)
QT_BEGIN_NAMESPACE Q_CORE_EXPORT const QLoggingCategory & QtForOhos()
Q_CORE_EXPORT Q_ATTRIBUTE_FORMAT_PRINTF(2, 0) void qOhosVPrintf(LogLevel logLevel
#define qOhosDebug(category)
Q_CORE_EXPORT const char * format
Q_CORE_EXPORT const char std::va_list ap
QCScopedDebugJS(StringType message)
QCScopedDebug(StringType message)