9enum LogLevel { DEBUG, NOTICE, WARNING, ERROR, CRITICAL, TIME };
14 const std::string filename;
15 vex::brain::sdcard sd;
16 void write_level(LogLevel l);
23 explicit Logger(
const std::string &filename);
32 void Log(
const std::string &s);
37 void Log(LogLevel level,
const std::string &s);
41 void Logln(
const std::string &s);
46 void Logln(LogLevel level,
const std::string &s);
51 void Logf(
const char *fmt, ...);
57 void Logf(LogLevel level,
const char *fmt, ...);
Class to simplify writing to files.
Definition logger.h:12
Logger & operator=(const Logger &l)=delete
copying not allowed
void Logf(const char *fmt,...)
Write a formatted string to the log.
Definition logger.cpp:51
void Log(const std::string &s)
Write a string to the log.
Definition logger.cpp:35
Logger(const std::string &filename)
Create a logger that will save to a file.
Definition logger.cpp:33
void Logln(const std::string &s)
Write a string and newline to the log.
Definition logger.cpp:41
static constexpr int MAX_FORMAT_LEN
maximum size for a string to be before it's written
Definition logger.h:20
Logger(const Logger &l)=delete
copying not allowed