1#ifndef CONSOLE_LOGGER_H
2#define CONSOLE_LOGGER_H
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;
29 void logInfo(std::string key,
int val)
override;
32 void logError(std::string key,
int val)
override;
33 void logFatal(std::string key,
int val)
override;
35 void logInfo(std::string key,
double val)
override;
38 void logError(std::string key,
double val)
override;
39 void logFatal(std::string key,
double val)
override;
41 void logInfo(std::string key,
bool val)
override;
44 void logError(std::string key,
bool val)
override;
45 void logFatal(std::string key,
bool val)
override;
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;
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;
62 void log(
Logging::Level level, std::string key, std::string fmt, va_list ap) {
67 std::cout <<
levelToString(level) <<
" - " << key <<
": " << val
73#define ConsoleWriter subzero::ConsoleLogger::getInstance()
79#define ConsoleInfo(key, fmt, ...) \
80 frc2::InstantCommand([] { \
81 ConsoleWriter.logInfo(key, fmt, __VA_ARGS__); \
88#define ConsoleVerbose(key, fmt, ...) \
89 frc2::InstantCommand([] { \
90 ConsoleWriter.logVerbose(key, fmt, __VA_ARGS__); \
Outputs formatted strings to stdout.
void logError(std::string key, const std::string format,...) override
void logFatal(std::string key, bool val) override
void logFatal(std::string key, wpi::Sendable *val) override
void logVerbose(std::string key, double val) override
void logInfo(std::string key, const std::string format,...) override
void logVerbose(std::string key, bool val) override
void logVerbose(std::string key, wpi::Sendable *val) override
void logWarning(std::string key, int val) override
void logFatal(std::string key, const std::string format,...) override
void logInfo(std::string key, double val) override
void logWarning(std::string key, wpi::Sendable *val) override
void logInfo(std::string key, frc::Pose2d &val) override
void logFatal(std::string key, double val) override
void logWarning(std::string key, bool val) override
void logError(std::string key, frc::Pose2d &val) override
void logWarning(std::string key, frc::Pose2d &val) override
void logVerbose(std::string key, int val) override
void logVerbose(std::string key, frc::Pose2d &val) override
void logError(std::string key, bool val) override
void logError(std::string key, int val) override
void logWarning(std::string key, const std::string format,...) override
static ConsoleLogger & getInstance()
void logFatal(std::string key, frc::Pose2d &val) override
void logFatal(std::string key, int val) override
void logInfo(std::string key, wpi::Sendable *val) override
void logError(std::string key, wpi::Sendable *val) override
void logInfo(std::string key, bool val) override
void logError(std::string key, double val) override
void logWarning(std::string key, double val) override
void logInfo(std::string key, int val) override
void logVerbose(std::string key, const std::string format,...) override
bool shouldLog(Logging::Level level)
std::string levelToString(Logging::Level level) const
std::string formatString(const std::string format, va_list ap)