-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathLogger.h
More file actions
37 lines (28 loc) · 708 Bytes
/
Copy pathLogger.h
File metadata and controls
37 lines (28 loc) · 708 Bytes
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
/*
* Logger.h
*
* Created on: 05/lug/2017
* Author: Stefano Ceccherini
*/
#ifndef LOGGER_H_
#define LOGGER_H_
#include <string>
#include <syslog.h>
class Logger {
public:
enum LOGGER_TYPE {
LOGGER_TYPE_DEFAULT = 0,
LOGGER_TYPE_STDERR = 1,
LOGGER_TYPE_SYSLOG = 2
};
static void SetLevel(int level);
static void Log(int level, const char* const string);
static void LogFormat(int level, const char* fmtString, ...);
static void SetLogger(LOGGER_TYPE loggerType = LOGGER_TYPE_DEFAULT);
static void SetLogger(const std::string& loggerType);
private:
static void _DoLog(int level, const char* string);
static LOGGER_TYPE sLogType;
static int sLevel;
};
#endif /* LOGGER_H_ */