-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogManager.hpp
49 lines (40 loc) · 849 Bytes
/
LogManager.hpp
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
47
48
49
//
// LogManager.hpp for ChessIA in /home/wilmot_p/PROG/C++/ChessIA
//
// Made by WILMOT Pierre
// Login <[email protected]>
//
// Started on Sun Jan 13 20:37:49 2013 WILMOT Pierre
// Last update Fri Jan 18 02:28:52 2013 WILMOT Pierre
//
#ifndef __LOGMANAGER_HPP__
#define __LOGMANAGER_HPP__
#include <iostream>
#include <fstream>
#include "Mutex.hpp"
#define LOGFILE_PATH "/home/wilmot_p/ChessIAlogfile"
class LogManager
{
public:
enum e_source
{
UCI,
UCI_IN,
UCI_OUT,
MinMax,
ChessBoard,
Unknow
};
public:
~LogManager();
static LogManager *getInstance();
void log(std::string const &s, e_source source = Unknow);
private:
LogManager();
private:
static LogManager *m_alreadyCreated;
std::ofstream m_logfile;
int m_colorCodes[Unknow + 1];
Mutex m_mutex;
};
#endif