-
Notifications
You must be signed in to change notification settings - Fork 0
/
XbeeLogger.h
46 lines (32 loc) · 1.11 KB
/
XbeeLogger.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef XBEELOGGER_H
#define XBEELOGGER_H
#include <string>
//#include <iostream>
//typedef void (*t_logFnc)(std::string msg, std::string origin);
static const std::string SeverityLabel[] = {"Error", "Warning", "Info", "Debug"};
class XbeeLogger
{
public:
enum class Severity:uint8_t { Error, Warning, Info, Debug };
static XbeeLogger& GetInstance();
static void setLogger(XbeeLogger &log);
virtual void doLog(const std::string &msg, Severity severity, const std::string &origin);
/* template <typename T>
XbeeLogger& operator << (const T &data) const
{
std::cout << data;
return *this;
}*/
// void setLogger(t_logFnc l) { logger = l; }
void setSeverity(Severity sev) { sevLimit = sev; }
protected:
XbeeLogger();
private:
XbeeLogger(XbeeLogger const&); // Don't Implement
void operator=(XbeeLogger const&); // Don't implement
// t_logFnc logger;
Severity sevLimit;
static XbeeLogger *logger;
static bool initialized;
};
#endif // XBEELOGGER_H