-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogManager.h
39 lines (33 loc) · 891 Bytes
/
LogManager.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
#ifndef __LOG_MANAGER_H__
# define __LOG_MANAGER_H__
#include < stdio.h >
#include "Manager.h"
# define LM df :: LogManager :: getInstance ()
namespace df {
class LogManager : public Manager
{
private:
const char* LOGFILE_NAME = "dragonfly.log";
bool m_didflush;
bool log_time_string;
bool log_step_count;
FILE* p_logFile;
int log_level;
public:
LogManager();
~LogManager();
static LogManager& getInstance();
//Opens the logfile
virtual int startUp();
//Closes the logfile
virtual void shutDown();
//Sets the flush of the log file after each write
void setFlush(bool didFlush = true);
//Writes to the log file and returns the number of bytes written or -1 if error
int writeLog(int level, const char* fmt, ...);
int writeLog(const char* fmt, ...) const;
//Gets log level
int getLogLevel();
};
}
#endif