Alternative fix using a customized implementation for QMessageLogger functions

This commit is contained in:
Matthias Koefferlein
2021-11-10 23:38:33 +01:00
parent 01d7600b87
commit 3ce7038a7d
2 changed files with 92 additions and 222 deletions
+51
View File
@@ -425,6 +425,57 @@ add_native_impl_polygons
no_copy_ctor "QBasicMutex"
no_copy_ctor "QMapDataBase"
drop_method "QMessageLogger", /QMessageLogger::critical.*\.\.\./ # does not support ...
drop_method "QMessageLogger", /QMessageLogger::debug.*\.\.\./ # does not support ...
drop_method "QMessageLogger", /QMessageLogger::fatal.*\.\.\./ # does not support ...
drop_method "QMessageLogger", /QMessageLogger::info.*\.\.\./ # does not support ...
drop_method "QMessageLogger", /QMessageLogger::noDebug.*\.\.\./ # does not support ...
drop_method "QMessageLogger", /QMessageLogger::warning.*\.\.\./ # does not support ...
add_native_impl("QMessageLogger", <<'CODE', <<'DECL')
static void critical1(QMessageLogger *logger, const char *msg) {
logger->critical("%s", msg);
}
static void critical2(QMessageLogger *logger, const QLoggingCategory &cat, const char *msg) {
logger->critical(cat, "%s", msg);
}
static void debug1(QMessageLogger *logger, const char *msg) {
logger->debug("%s", msg);
}
static void debug2(QMessageLogger *logger, const QLoggingCategory &cat, const char *msg) {
logger->debug(cat, "%s", msg);
}
static void fatal1(QMessageLogger *logger, const char *msg) {
logger->fatal("%s", msg);
}
static void info1(QMessageLogger *logger, const char *msg) {
logger->info("%s", msg);
}
static void info2(QMessageLogger *logger, const QLoggingCategory &cat, const char *msg) {
logger->info(cat, "%s", msg);
}
static void noDebug1(QMessageLogger *logger, const char *msg) {
logger->noDebug("%s", msg);
}
static void warning1(QMessageLogger *logger, const char *msg) {
logger->warning("%s", msg);
}
static void warning2(QMessageLogger *logger, const QLoggingCategory &cat, const char *msg) {
logger->warning(cat, "%s", msg);
}
CODE
gsi::method_ext("critical", &critical1, "@brief Method void QMessageLogger::critical(const char *msg)") +
gsi::method_ext("critical", &critical2, "@brief Method void QMessageLogger::critical(const QLoggingCategory &cat, const char *msg)") +
gsi::method_ext("debug", &debug1, "@brief Method void QMessageLogger::debug(const char *msg)") +
gsi::method_ext("debug", &debug2, "@brief Method void QMessageLogger::debug(const QLoggingCategory &cat, const char *msg)") +
gsi::method_ext("fatal", &fatal1, "@brief Method void QMessageLogger::fatal(const char *msg)") +
gsi::method_ext("info", &info1, "@brief Method void QMessageLogger::info(const char *msg)") +
gsi::method_ext("info", &info2, "@brief Method void QMessageLogger::info(const QLoggingCategory &cat, const char *msg)") +
gsi::method_ext("noDebug", &noDebug1, "@brief Method void QMessageLogger::noDebug(const char *msg)") +
gsi::method_ext("warning", &warning1, "@brief Method void QMessageLogger::warning(const char *msg)") +
gsi::method_ext("warning", &warning2, "@brief Method void QMessageLogger::warning(const QLoggingCategory &cat, const char *msg)")
DECL
# --------------------------------------------------------------
# QtGui