-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.cpp
executable file
·52 lines (46 loc) · 969 Bytes
/
log.cpp
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
50
51
52
/**********************************************************************
|
| Bogart
| Chess Engine
|
| Copyright (C) 2009-2013 Dr.Kameleon
|
|**********************************************************************
| log.cpp
|**********************************************************************/
#include "bogart.h"
//=======================================================
// Message Logging
//=======================================================
void Log::msg(string msg)
{
if (msg.length()>3)
{
if (UCI)
{
ofstream logfile;
logfile.open(LOGFILE,ios::app);
logfile << msg << endl;
logfile.close();
}
else
{
printf("%s\n",msg.c_str());
}
}
}
void Log::out(string msg)
{
Log::msg(">> " + msg);
}
void Log::in(string msg)
{
Log::msg("<< " + msg);
}
void Log::start()
{
ofstream logfile;
logfile.open(LOGFILE);
logfile << endl;
logfile.close();
}