1
0
mirror of synced 2025-01-31 03:53:44 +01:00

impr: Properly allow multi-threaded logging without messing up output

This commit is contained in:
WerWolv 2023-06-12 08:24:36 +02:00
parent ef1d831158
commit 7de367a944
2 changed files with 4 additions and 1 deletions

View File

@ -36,6 +36,9 @@ namespace hex::log {
[[maybe_unused]] void print(const fmt::text_style &ts, const std::string &level, const std::string &fmt, auto... args) {
auto dest = getDestination();
static std::mutex loggerMutex;
std::scoped_lock lock(loggerMutex);
printPrefix(dest, ts, level);
fmt::print(dest, fmt::runtime(fmt), args...);
fmt::print(dest, "\n");

View File

@ -540,7 +540,7 @@ namespace hex::plugin::builtin {
auto &runtime = ContentRegistry::PatternLanguage::getRuntime();
auto &evaluator = runtime.getInternals().evaluator;
if (ImGui::BeginChild("##debugger", size, true, ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
if (ImGui::BeginChild("##debugger", size, true)) {
const auto &breakpoints = evaluator->getBreakpoints();
auto line = this->m_textEditor.GetCursorPosition().mLine + 1;