Revert "Qt logging through cloudlog (#21452)"

This reverts commit 54b6a9f121.
pull/21511/head
ShaneSmiskol 4 years ago
parent a816206581
commit d9689a5505
  1. 3
      SConstruct
  2. 1
      selfdrive/ui/main.cc
  3. 9
      selfdrive/ui/qt/onroad.cc
  4. 20
      selfdrive/ui/qt/util.cc
  5. 1
      selfdrive/ui/qt/util.h

@ -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']

@ -7,7 +7,6 @@
#include "selfdrive/ui/qt/window.h"
int main(int argc, char *argv[]) {
qInstallMessageHandler(swagLogMessageHandler);
setQtSurfaceFormat();
if (Hardware::EON()) {

@ -1,7 +1,6 @@
#include "selfdrive/ui/qt/onroad.h"
#include <iostream>
#include <QDebug>
#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();

@ -4,7 +4,6 @@
#include <QStyleOption>
#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<QtMsgType, int> 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());
}

@ -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
{

Loading…
Cancel
Save