improve UI visibility of System/Logger
This commit is contained in:
@@ -133,9 +133,6 @@ class Node::Lambda final : public nf7::Node::Lambda,
|
||||
f_->Build().
|
||||
ThenIf(self, [this, in](auto& func) mutable {
|
||||
if (f_) StartThread(in, func);
|
||||
}).
|
||||
Catch<nf7::Exception>([log = log_](auto&) {
|
||||
log->Warn("skips execution because of build failure");
|
||||
});
|
||||
} catch (nf7::ExpiredException&) {
|
||||
}
|
||||
|
||||
@@ -331,9 +331,31 @@ void Logger::LogView() noexcept {
|
||||
}
|
||||
// msg column
|
||||
if (ImGui::TableNextColumn()) {
|
||||
ImGui::TextUnformatted(row.msg.c_str());
|
||||
auto len = row.msg.find('\n');
|
||||
if (len == std::string::npos) {
|
||||
len = row.msg.size();
|
||||
}
|
||||
const char* str = row.msg.c_str();
|
||||
ImGui::TextUnformatted(str, str+len);
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip(row.msg.c_str());
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::TextUnformatted(row.msg.c_str());
|
||||
if (row.ex) {
|
||||
ImGui::Spacing();
|
||||
ImGui::TextUnformatted("exception stack:");
|
||||
for (auto ptr = row.ex; ptr;)
|
||||
try {
|
||||
ImGui::Bullet();
|
||||
std::rethrow_exception(ptr);
|
||||
} catch (Exception& e) {
|
||||
ImGui::TextUnformatted(e.msg().c_str());
|
||||
ptr = e.reason();
|
||||
} catch (std::exception& e) {
|
||||
ImGui::TextUnformatted(e.what());
|
||||
ptr = nullptr;
|
||||
}
|
||||
}
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
}
|
||||
// path column
|
||||
|
||||
Reference in New Issue
Block a user