mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +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:
@@ -4,8 +4,8 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/print.h>
|
||||
|
||||
#include "wpinet/DsClient.h"
|
||||
#include "wpinet/EventLoopRunner.h"
|
||||
@@ -27,7 +27,7 @@ int main() {
|
||||
loop.ExecAsync([&](uv::Loop& loop) {
|
||||
client = wpi::DsClient::Create(loop, logger);
|
||||
client->setIp.connect(
|
||||
[](std::string_view ip) { fmt::print("got IP: {}\n", ip); });
|
||||
[](std::string_view ip) { wpi::print("got IP: {}\n", ip); });
|
||||
client->clearIp.connect([] { std::fputs("cleared IP\n", stdout); });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user