RIT VEXU Core API
Toggle main menu visibility
Loading...
Searching...
No Matches
logger.h
1
#pragma once
2
3
#include "vex.h"
4
#include <cstdarg>
5
#include <cstdio>
6
#include <string>
7
9
enum
LogLevel { DEBUG, NOTICE, WARNING, ERROR, CRITICAL, TIME };
10
12
class
Logger
{
13
private
:
14
const
std::string filename;
15
vex::brain::sdcard sd;
16
void
write_level(LogLevel l);
17
18
public
:
20
static
constexpr
int
MAX_FORMAT_LEN
= 512;
23
explicit
Logger
(
const
std::string &filename);
24
26
Logger
(
const
Logger
&l) =
delete
;
28
Logger
&
operator=
(
const
Logger
&l) =
delete
;
29
32
void
Log
(
const
std::string &s);
33
37
void
Log
(LogLevel level,
const
std::string &s);
38
41
void
Logln
(
const
std::string &s);
42
46
void
Logln
(LogLevel level,
const
std::string &s);
47
51
void
Logf
(
const
char
*fmt, ...);
52
57
void
Logf
(LogLevel level,
const
char
*fmt, ...);
58
};
Logger::operator=
Logger & operator=(const Logger &l)=delete
copying not allowed
Logger::Logf
void Logf(const char *fmt,...)
Write a formatted string to the log.
Definition
logger.cpp:51
Logger::Log
void Log(const std::string &s)
Write a string to the log.
Definition
logger.cpp:35
Logger::Logger
Logger(const std::string &filename)
Create a logger that will save to a file.
Definition
logger.cpp:33
Logger::Logln
void Logln(const std::string &s)
Write a string and newline to the log.
Definition
logger.cpp:41
Logger::MAX_FORMAT_LEN
static constexpr int MAX_FORMAT_LEN
maximum size for a string to be before it's written
Definition
logger.h:20
Logger::Logger
Logger(const Logger &l)=delete
copying not allowed
include
core
utils
logger.h
Generated by
1.17.0