Store user data in $HOME
[kball.git] / include / mytracer.h
blob42e180cca8a79ab8581dce20ef0e05403a6ad762
1 // ------------------------------------------------------------------
2 // mytracer.h
3 // ------------------------------------------------------------------
4 // This implements a tracer for debugging the game
5 // Basically, it records events on disk, so we can trace where the hell
6 // the bastard is crashing!
7 // ------------------------------------------------------------------
8 // Developed By Kronoman - Copyright (c) 2004
9 // In loving memory of my father
10 // ------------------------------------------------------------------
12 #ifndef MYTRACER_H
13 #define MYTRACER_H
15 #include <string>
16 using namespace std;
18 // yeah, sue me, I'm using C functions (I have my reasons, so, be nice and STFU)
19 #include <stdio.h>
20 #include <stdarg.h> // for the variable argument list
22 // file to save the trace (filename, 8.3 chars to keep compatibility with DOS)
23 #define TRACE_SAVE_IN_FILE "tracelog.txt"
25 class CMyTracer
27 public:
28 CMyTracer();
29 ~CMyTracer();
31 void add(string txt);
32 void add(const char *msg, ...); // format like printf :O
34 void reset(); // reset the file where we are tracing (OVERWRITES THE FILE!)
36 // NOTE: this is configuration for all class objects (notice the 'static')
37 static bool DISABLE_TRACE; // define this to true to DISABLE the logging
41 #endif