mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41: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 "Robot.h"
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <frc/smartdashboard/SmartDashboard.h>
|
||||
#include <wpi/print.h>
|
||||
|
||||
void Robot::RobotInit() {
|
||||
m_chooser.SetDefaultOption(kAutoNameDefault, kAutoNameDefault);
|
||||
@@ -38,7 +38,7 @@ void Robot::AutonomousInit() {
|
||||
m_autoSelected = m_chooser.GetSelected();
|
||||
// m_autoSelected = SmartDashboard::GetString("Auto Selector",
|
||||
// kAutoNameDefault);
|
||||
fmt::print("Auto selected: {}\n", m_autoSelected);
|
||||
wpi::print("Auto selected: {}\n", m_autoSelected);
|
||||
|
||||
if (m_autoSelected == kAutoNameCustom) {
|
||||
// Custom Auto goes here
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
#include "Robot.h"
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <frc/livewindow/LiveWindow.h>
|
||||
#include <frc/smartdashboard/SmartDashboard.h>
|
||||
#include <wpi/print.h>
|
||||
|
||||
// Run robot periodic() functions for 5 ms, and run controllers every 10 ms
|
||||
Robot::Robot() : frc::TimesliceRobot{5_ms, 10_ms} {
|
||||
@@ -56,7 +56,7 @@ void Robot::AutonomousInit() {
|
||||
m_autoSelected = m_chooser.GetSelected();
|
||||
// m_autoSelected = SmartDashboard::GetString("Auto Selector",
|
||||
// kAutoNameDefault);
|
||||
fmt::print("Auto selected: {}\n", m_autoSelected);
|
||||
wpi::print("Auto selected: {}\n", m_autoSelected);
|
||||
|
||||
if (m_autoSelected == kAutoNameCustom) {
|
||||
// Custom Auto goes here
|
||||
|
||||
Reference in New Issue
Block a user