mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Add usage reporting for loggers (#7450)
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include <fmt/chrono.h>
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <networktables/NetworkTableInstance.h>
|
||||
#include <wpi/DataLog.h>
|
||||
#include <wpi/DataLogBackgroundWriter.h>
|
||||
@@ -78,6 +79,8 @@ static std::string MakeLogDir(std::string_view dir) {
|
||||
(s.permissions() & fs::perms::others_write) != fs::perms::none) {
|
||||
fs::create_directory("/u/logs", ec);
|
||||
return "/u/logs";
|
||||
HAL_Report(HALUsageReporting::kResourceType_DataLogManager,
|
||||
HALUsageReporting::kDataLogLocation_USB);
|
||||
}
|
||||
if (RobotBase::GetRuntimeType() == kRoboRIO) {
|
||||
FRC_ReportWarning(
|
||||
@@ -85,6 +88,8 @@ static std::string MakeLogDir(std::string_view dir) {
|
||||
"not recommended! Plug in a FAT32 formatted flash drive!");
|
||||
}
|
||||
fs::create_directory("/home/lvuser/logs", ec);
|
||||
HAL_Report(HALUsageReporting::kResourceType_DataLogManager,
|
||||
HALUsageReporting::kDataLogLocation_Onboard);
|
||||
return "/home/lvuser/logs";
|
||||
#else
|
||||
std::string logDir = filesystem::GetOperatingDirectory() + "/logs";
|
||||
|
||||
Reference in New Issue
Block a user