GamemComms
A GameComms.dll re-implementation for the Nokia N-Gage
SGEDebugLog.h
Go to the documentation of this file.
1 
10 #ifndef DEBUGLOG_H
11 #define DEBUGLOG_H
12 
13 #include <e32std.h>
14 #include <f32file.h>
15 
27 {
28 public:
29  enum TLogLevel { ENone, ECritical, EMajor, EAll };
30 
39  IMPORT_C RSGEDebugLog();
40 
49  IMPORT_C virtual ~RSGEDebugLog();
50 
63  IMPORT_C TInt Open();
64 
72  IMPORT_C void Close();
73 
89  IMPORT_C TInt WriteLine(const char* aText, TLogLevel aLevel = EAll);
90 
108  IMPORT_C TInt WriteLine(const char* aText, TInt aInt, TLogLevel aLevel = EAll);
109 
127  IMPORT_C TInt WriteLine(const char* aText, TUint32 aHex, TLogLevel aLevel = EAll);
128 
144  IMPORT_C TInt Write(const char* aText, TLogLevel aLevel = EAll);
145 
161  IMPORT_C TInt Write(const TInt aInt, TLogLevel aLevel = EAll);
162 
178  IMPORT_C TInt Write(const TUint32 aHex, TLogLevel aLevel = EAll);
179 
195  IMPORT_C TInt Write(const TUint8 aHex, TLogLevel aLevel = EAll);
196 
212  IMPORT_C TInt Write(const char aChar, TLogLevel aLevel = EAll);
213 
229  IMPORT_C TInt Write(const TDesC& aDesC, TLogLevel aLevel = EAll);
230 
245  IMPORT_C TInt NewLine(TLogLevel aLevel = EAll);
246 
260  IMPORT_C void SetLoggingLevel(TLogLevel aLevel);
261 
262 protected:
263  RFile iDebugLogFile;
264  RFs iDebugLogFs;
265  TLogLevel iLoggingLevel;
266 };
267 
268 #endif // DEBUGLOG_H
Provides output to a debug log on device (E:\debug.log). This slows down performance markedly.
Definition: SGEDebugLog.h:27
IMPORT_C void SetLoggingLevel(TLogLevel aLevel)
Determines the minimum priority level required for the entry to be written to the log.
Definition: SGEDebugLog.cpp:103
IMPORT_C TInt WriteLine(const char *aText, TLogLevel aLevel=EAll)
Writes a line to the debug log file.
Definition: SGEDebugLog.cpp:33
IMPORT_C RSGEDebugLog()
Default C++ Constructor.
Definition: SGEDebugLog.cpp:14
virtual IMPORT_C ~RSGEDebugLog()
Destructor.
Definition: SGEDebugLog.cpp:18
IMPORT_C TInt NewLine(TLogLevel aLevel=EAll)
Writes a newline character to the current position in the debug log file.
Definition: SGEDebugLog.cpp:96
IMPORT_C TInt Open()
Creates the log file (note this will overwrite any previous instance of the log file).
IMPORT_C void Close()
Closes the debug log file.
Definition: SGEDebugLog.cpp:29
IMPORT_C TInt Write(const char *aText, TLogLevel aLevel=EAll)
Writes text to the debug log file.
Definition: SGEDebugLog.cpp:54