Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
vtLog.h
Go to the documentation of this file.
1 //
2 // Log - simple message logging to a file.
3 //
4 // Copyright (c) 2002-2006 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
9 #ifndef VTLOG_H
10 #define VTLOG_H
11 
12 #include "config_vtdata.h"
13 #include <stdio.h>
14 
39 class vtLog
40 {
41 public:
42  vtLog();
43  ~vtLog();
44 
45  void StartLog(const char *fname);
46  void Log(const char *str);
47  void Log(char ch);
48  void Printf(const char *pFormat, ...);
49 
50 #if SUPPORT_WSTRING
51  void Log(const wchar_t *str);
52  void Printf(const wchar_t *pFormat, ...);
53 #endif
54 
55 private:
56  FILE *m_log;
57 };
58 
59 extern vtLog g_Log;
60 #define VTSTARTLOG g_Log.StartLog
61 #define VTLOG g_Log.Printf
62 #define VTLOG1 g_Log.Log // for simple strings, takes 1 argument
63 
64 #endif // VTLOG_H
65