mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpiutil] Upgrade to fmt 10.2.1, add wpi::print (#6161)
We now use a wrapper (wpi::print) to catch exceptions since we can't patch std::print() to not throw when we ultimately migrate to it. fmtlib and std format/print throw the same exceptions and always have. We previously patched fmt::print() to not throw a write failure exception, but we can't do that for std::print(); wpi::print() is the migration plan.
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <glass/Context.h>
|
||||
#include <glass/MainMenuBar.h>
|
||||
#include <glass/Storage.h>
|
||||
@@ -20,6 +19,7 @@
|
||||
#include <imgui.h>
|
||||
#include <uv.h>
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/print.h>
|
||||
#include <wpigui.h>
|
||||
#include <wpigui_openurl.h>
|
||||
|
||||
@@ -89,7 +89,7 @@ void Application(std::string_view saveDir) {
|
||||
std::string filename = std::filesystem::path{file}.filename().string();
|
||||
gLog.Append(fmt::format("{}{} ({}:{})\n", lvl, msg, filename, line));
|
||||
#ifndef NDEBUG
|
||||
fmt::print(stderr, "{}{} ({}:{})\n", lvl, msg, filename, line);
|
||||
wpi::print(stderr, "{}{} ({}:{})\n", lvl, msg, filename, line);
|
||||
#endif
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user