blob: 5ecdc7e9ad6fecb5ee2865f051cb7592b2c061d4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#ifndef LOGGER_H
#define LOGGER_H
#include <fstream>
#include <sstream>
using namespace std;
enum LogLevel { DEBUG, INFO, WARNING, ERROR, CRITICAL };
class Logger
{
public:
Logger(const string &);
~Logger();
void setLevel(LogLevel);
void log(LogLevel, const string &);
private:
LogLevel level = INFO;
ofstream logFile;
string levelToString(LogLevel);
int levelToInt(LogLevel);
};
#endif /* LOGGER_H_INCLUDED */
|