canidae / saiph

S* AI Playing netHack

saiph / Debug.h
100644 32 lines (28 sloc) 0.78 kb
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
#ifndef DEBUG_H
#define DEBUG_H
 
extern "C" {
#include <sys/stat.h>
}
#include <fstream>
#include <string>
 
class Debug {
public:
static void init(const std::string& file);
static void destroy();
static std::ofstream& custom(const std::string& name);
static std::ofstream& command();
static std::ofstream& event();
static std::ofstream& inventory();
static std::ofstream& pathing();
static std::ofstream& info();
static std::ofstream& notice();
static std::ofstream& warning();
static std::ofstream& error();
static void rawCharArray(const char* data, const int& start, const int& stop);
 
private:
static std::ofstream _debugfile;
static std::string _timestamp;
 
static std::ofstream& header(const std::string& category);
static std::string& printTime();
};
#endif