server logger

move over to qt signals that are processed in simulators
This commit is contained in:
2026-02-14 14:32:49 +01:00
parent 043c19c537
commit 16e6100465
4 changed files with 30 additions and 4 deletions
+6
View File
@@ -1,6 +1,7 @@
#include "simulators.hpp"
#define INTERNAL
#include "simulator_base.hpp"
#include "spdlog/spdlog.h"
#include "websocket.hpp"
#include <QCoreApplication>
#include <QDirIterator>
@@ -153,6 +154,11 @@ void Simulators::switch_simulator(std::string name)
}
},
Qt::QueuedConnection);
connect(m_simulators.at(m_current_simulator).get(), &Simulator_base::log_signal, this,
[](const char *filename_in, int line_in, const char *funcname_in, int level, QString msg) {
spdlog::default_logger_raw()->log(spdlog::source_loc{filename_in, line_in, funcname_in},
(spdlog::level::level_enum)level, msg.toStdString());
});
this->start();
}