[wpilib] DataLogManager: Warn user if logging to RoboRIO 1 internal storage (#5617)

This commit is contained in:
Ryan Blue
2023-09-11 18:47:31 -04:00
committed by GitHub
parent 7a9a901a73
commit 339ef1ea39
2 changed files with 12 additions and 1 deletions

View File

@@ -21,6 +21,7 @@
#include "frc/DriverStation.h"
#include "frc/Filesystem.h"
#include "frc/RobotBase.h"
using namespace frc;
@@ -69,6 +70,11 @@ static std::string MakeLogDir(std::string_view dir) {
(s.permissions() & fs::perms::others_write) != fs::perms::none) {
return std::string{usbDir};
}
if (frc::RobotBase::GetRuntimeType() == kRoboRIO) {
FRC_ReportError(warn::Warning,
"DataLogManager: Logging to RoboRIO 1 internal storage is "
"not recommended! Plug in a FAT32 formatted flash drive!");
}
#endif
return frc::filesystem::GetOperatingDirectory();
}

View File

@@ -204,8 +204,13 @@ public final class DataLogManager {
} catch (IOException ex) {
// ignored
}
if (RobotBase.getRuntimeType() == RuntimeType.kRoboRIO) {
DriverStation.reportWarning(
"DataLogManager: Logging to RoboRIO 1 internal storage is not recommended!"
+ " Plug in a FAT32 formatted flash drive!",
false);
}
}
return Filesystem.getOperatingDirectory().getAbsolutePath();
}