SubZero Common
Common library components for an FRC CommandRobot
Loading...
Searching...
No Matches
ShuffleboardLogger.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4#include <string>
5
7
8namespace subzero {
9
16public:
18 static ShuffleboardLogger instance;
19
20 return instance;
21 }
22
23 void logVerbose(std::string key, const std::string format, ...) override;
24 void logInfo(std::string key, const std::string format, ...) override;
25 void logWarning(std::string key, const std::string format, ...) override;
26 void logError(std::string key, const std::string format, ...) override;
27 void logFatal(std::string key, const std::string format, ...) override;
28
29 void logInfo(std::string key, int val) override;
30 void logVerbose(std::string key, int val) override;
31 void logWarning(std::string key, int val) override;
32 void logError(std::string key, int val) override;
33 void logFatal(std::string key, int val) override;
34
35 void logInfo(std::string key, double val) override;
36 void logVerbose(std::string key, double val) override;
37 void logWarning(std::string key, double val) override;
38 void logError(std::string key, double val) override;
39 void logFatal(std::string key, double val) override;
40
41 void logInfo(std::string key, bool val) override;
42 void logVerbose(std::string key, bool val) override;
43 void logWarning(std::string key, bool val) override;
44 void logError(std::string key, bool val) override;
45 void logFatal(std::string key, bool val) override;
46
47 void logInfo(std::string key, frc::Pose2d &val) override;
48 void logVerbose(std::string key, frc::Pose2d &val) override;
49 void logWarning(std::string key, frc::Pose2d &val) override;
50 void logError(std::string key, frc::Pose2d &val) override;
51 void logFatal(std::string key, frc::Pose2d &val) override;
52
53 void logInfo(std::string key, wpi::Sendable *val) override;
54 void logVerbose(std::string key, wpi::Sendable *val) override;
55 void logWarning(std::string key, wpi::Sendable *val) override;
56 void logError(std::string key, wpi::Sendable *val) override;
57 void logFatal(std::string key, wpi::Sendable *val) override;
58
59private:
61
62 std::string formatToShuffleboardString(Logging::Level level,
63 const std::string format, ...) {
64 va_list args;
65 va_start(args, format);
66 std::string val = formatString(format, args);
67 val = levelToString(level) + " - " + val;
68 va_end(args);
69
70 return val;
71 }
72};
73} // namespace subzero
Logger interface.
Definition ILogger.h:19
std::string levelToString(Logging::Level level) const
Definition ILogger.h:64
std::string formatString(const std::string format, va_list ap)
Definition ILogger.h:83
Outputs formatted information to SmartDashboard.
void logFatal(std::string key, const std::string format,...) override
void logFatal(std::string key, bool val) override
void logError(std::string key, bool val) override
void logError(std::string key, int val) override
void logError(std::string key, frc::Pose2d &val) override
void logVerbose(std::string key, const std::string format,...) override
void logWarning(std::string key, double val) override
void logWarning(std::string key, frc::Pose2d &val) override
void logError(std::string key, wpi::Sendable *val) override
void logFatal(std::string key, frc::Pose2d &val) override
void logFatal(std::string key, double val) override
void logWarning(std::string key, wpi::Sendable *val) override
void logVerbose(std::string key, frc::Pose2d &val) override
void logInfo(std::string key, bool val) override
void logInfo(std::string key, frc::Pose2d &val) override
void logInfo(std::string key, const std::string format,...) override
void logFatal(std::string key, int val) override
void logWarning(std::string key, const std::string format,...) override
void logWarning(std::string key, int val) override
void logVerbose(std::string key, bool val) override
static ShuffleboardLogger & getInstance()
void logWarning(std::string key, bool val) override
void logError(std::string key, double val) override
void logVerbose(std::string key, wpi::Sendable *val) override
void logFatal(std::string key, wpi::Sendable *val) override
void logVerbose(std::string key, int val) override
void logError(std::string key, const std::string format,...) override
void logVerbose(std::string key, double val) override
void logInfo(std::string key, double val) override
void logInfo(std::string key, wpi::Sendable *val) override
void logInfo(std::string key, int val) override
Level
Levels of logging.