From d9689a55057d53f7afe8e2ea28542eb80175a705 Mon Sep 17 00:00:00 2001 From: ShaneSmiskol Date: Wed, 7 Jul 2021 15:24:22 -0700 Subject: [PATCH] Revert "Qt logging through cloudlog (#21452)" This reverts commit 54b6a9f121aa7af0920016d7288b0037beca1260. --- SConstruct | 3 +-- selfdrive/ui/main.cc | 1 - selfdrive/ui/qt/onroad.cc | 9 ++++----- selfdrive/ui/qt/util.cc | 20 -------------------- selfdrive/ui/qt/util.h | 1 - 5 files changed, 5 insertions(+), 29 deletions(-) diff --git a/SConstruct b/SConstruct index 0886f2e086..f51946e963 100644 --- a/SConstruct +++ b/SConstruct @@ -319,8 +319,7 @@ qt_flags = [ "-DQT_QUICK_LIB", "-DQT_QUICKWIDGETS_LIB", "-DQT_QML_LIB", - "-DQT_CORE_LIB", - "-DQT_MESSAGELOGCONTEXT", + "-DQT_CORE_LIB" ] qt_env['CXXFLAGS'] += qt_flags qt_env['LIBPATH'] += ['#selfdrive/ui'] diff --git a/selfdrive/ui/main.cc b/selfdrive/ui/main.cc index 35268bd880..901899e39a 100644 --- a/selfdrive/ui/main.cc +++ b/selfdrive/ui/main.cc @@ -7,7 +7,6 @@ #include "selfdrive/ui/qt/window.h" int main(int argc, char *argv[]) { - qInstallMessageHandler(swagLogMessageHandler); setQtSurfaceFormat(); if (Hardware::EON()) { diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 296f063e87..c321e7ebe0 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -1,7 +1,6 @@ #include "selfdrive/ui/qt/onroad.h" #include -#include #include "selfdrive/common/swaglog.h" #include "selfdrive/common/timing.h" @@ -225,10 +224,10 @@ NvgWindow::~NvgWindow() { void NvgWindow::initializeGL() { initializeOpenGLFunctions(); - qInfo() << "OpenGL version:" << QString((const char*)glGetString(GL_VERSION)); - qInfo() << "OpenGL vendor:" << QString((const char*)glGetString(GL_VENDOR)); - qInfo() << "OpenGL renderer:" << QString((const char*)glGetString(GL_RENDERER)); - qInfo() << "OpenGL language version:" << QString((const char*)glGetString(GL_SHADING_LANGUAGE_VERSION)); + std::cout << "OpenGL version: " << glGetString(GL_VERSION) << std::endl; + std::cout << "OpenGL vendor: " << glGetString(GL_VENDOR) << std::endl; + std::cout << "OpenGL renderer: " << glGetString(GL_RENDERER) << std::endl; + std::cout << "OpenGL language version: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl; ui_nvg_init(&QUIState::ui_state); prev_draw_t = millis_since_boot(); diff --git a/selfdrive/ui/qt/util.cc b/selfdrive/ui/qt/util.cc index c077883d28..b26ae371f4 100644 --- a/selfdrive/ui/qt/util.cc +++ b/selfdrive/ui/qt/util.cc @@ -4,7 +4,6 @@ #include #include "selfdrive/common/params.h" -#include "selfdrive/common/swaglog.h" QString getBrand() { return Params().getBool("Passive") ? "dashcam" : "openpilot"; @@ -80,22 +79,3 @@ void ClickableWidget::paintEvent(QPaintEvent *) { QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } - - -void swagLogMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { - static std::map levels = { - {QtMsgType::QtDebugMsg, 10}, - {QtMsgType::QtInfoMsg, 20}, - {QtMsgType::QtWarningMsg, 30}, - {QtMsgType::QtCriticalMsg, 40}, - {QtMsgType::QtSystemMsg, 40}, - {QtMsgType::QtFatalMsg, 50}, - }; - - std::string file, function; - if (context.file != nullptr) file = context.file; - if (context.function != nullptr) function = context.function; - - auto bts = msg.toUtf8(); - cloudlog_e(levels[type], file.c_str(), context.line, function.c_str(), "%s", bts.constData()); -} diff --git a/selfdrive/ui/qt/util.h b/selfdrive/ui/qt/util.h index 6b9d4512b8..f56f640a3e 100644 --- a/selfdrive/ui/qt/util.h +++ b/selfdrive/ui/qt/util.h @@ -13,7 +13,6 @@ void configFont(QPainter &p, const QString &family, int size, const QString &sty void clearLayout(QLayout* layout); void setQtSurfaceFormat(); QString timeAgo(const QDateTime &date); -void swagLogMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg); class ClickableWidget : public QWidget {