GamemComms
A GameComms.dll re-implementation for the Nokia N-Gage
RSGEDebugLog Class Reference

Provides output to a debug log on device (E:\debug.log). This slows down performance markedly. More...

#include <SGEDebugLog.h>

Public Types

enum  TLogLevel { ENone , ECritical , EMajor , EAll }
 

Public Member Functions

RSGEDebugLog
IMPORT_C RSGEDebugLog ()
 Default C++ Constructor.
 
~RSGEDebugLog
virtual IMPORT_C ~RSGEDebugLog ()
 Destructor.
 
Open
IMPORT_C TInt Open ()
 Creates the log file (note this will overwrite any previous instance of the log file). More...
 
Close
IMPORT_C void Close ()
 Closes the debug log file.
 
WriteLine
IMPORT_C TInt WriteLine (const char *aText, TLogLevel aLevel=EAll)
 Writes a line to the debug log file. More...
 
IMPORT_C TInt WriteLine (const char *aText, TInt aInt, TLogLevel aLevel=EAll)
 Writes a line to the debug log file. More...
 
IMPORT_C TInt WriteLine (const char *aText, TUint32 aHex, TLogLevel aLevel=EAll)
 
Write
IMPORT_C TInt Write (const char *aText, TLogLevel aLevel=EAll)
 Writes text to the debug log file. More...
 
IMPORT_C TInt Write (const TInt aInt, TLogLevel aLevel=EAll)
 Writes integer as a string to the debug log file. More...
 
IMPORT_C TInt Write (const TUint32 aHex, TLogLevel aLevel=EAll)
 Writes integer as a hex string to the debug log file. More...
 
IMPORT_C TInt Write (const TUint8 aHex, TLogLevel aLevel=EAll)
 Writes integer as a hex string to the debug log file. More...
 
IMPORT_C TInt Write (const char aChar, TLogLevel aLevel=EAll)
 Writes character to the debug log file. More...
 
IMPORT_C TInt Write (const TDesC &aDesC, TLogLevel aLevel=EAll)
 
NewLine
IMPORT_C TInt NewLine (TLogLevel aLevel=EAll)
 Writes a newline character to the current position in the debug log file. More...
 

SetLoggingLevel

RFile iDebugLogFile
 
RFs iDebugLogFs
 
TLogLevel iLoggingLevel
 
IMPORT_C void SetLoggingLevel (TLogLevel aLevel)
 Determines the minimum priority level required for the entry to be written to the log. More...
 

Detailed Description

Provides output to a debug log on device (E:\debug.log). This slows down performance markedly.

Remarks
Note: Enable logging by defining ENABLE_LOG.

Member Function Documentation

◆ NewLine()

EXPORT_C TInt RSGEDebugLog::NewLine ( TLogLevel  aLevel = EAll)

Writes a newline character to the current position in the debug log file.

Parameters
aLevelPriority of logging - UI allows this to be set
Returns
Any EPOC error code
Return values
KErrNoneIf successful

◆ Open()

TInt RSGEDebugLog::Open ( )

Creates the log file (note this will overwrite any previous instance of the log file).

Returns
Any EPOC error code
Return values
KErrNoneIf successful

◆ SetLoggingLevel()

EXPORT_C void RSGEDebugLog::SetLoggingLevel ( TLogLevel  aLevel)

Determines the minimum priority level required for the entry to be written to the log.

It is useful if this can be set by a UI component in the game to avoid recompilation of code.

Parameters
aLevelPriority of logging - UI allows this to be set

◆ Write() [1/5]

EXPORT_C TInt RSGEDebugLog::Write ( const char *  aText,
TLogLevel  aLevel = EAll 
)

Writes text to the debug log file.

Parameters
aTextANSI text to write (can be string literal)
aLevelPriority of logging - UI allows this to be set
Returns
Any EPOC error code
Return values
KErrNoneIf successful

◆ Write() [2/5]

EXPORT_C TInt RSGEDebugLog::Write ( const char  aChar,
TLogLevel  aLevel = EAll 
)

Writes character to the debug log file.

Writes text to the debug log file.

Parameters
aCharANSI character to be written
aLevelPriority of logging - UI allows this to be set
Returns
Any EPOC error code
Return values
KErrNoneIf successful
Parameters
aCharDescriptor containing text to write to the log
aLevelPriority of logging - UI allows this to be set
Returns
Any EPOC error code
Return values
KErrNoneIf successful

◆ Write() [3/5]

EXPORT_C TInt RSGEDebugLog::Write ( const TInt  aInt,
TLogLevel  aLevel = EAll 
)

Writes integer as a string to the debug log file.

Parameters
aIntInteger to be written as a string
aLevelPriority of logging - UI allows this to be set
Returns
Any EPOC error code
Return values
KErrNoneIf successful

◆ Write() [4/5]

EXPORT_C TInt RSGEDebugLog::Write ( const TUint32  aHex,
TLogLevel  aLevel = EAll 
)

Writes integer as a hex string to the debug log file.

Parameters
aHexInteger to be written as a hex string
aLevelPriority of logging - UI allows this to be set
Returns
Any EPOC error code
Return values
KErrNoneIf successful

◆ Write() [5/5]

EXPORT_C TInt RSGEDebugLog::Write ( const TUint8  aHex,
TLogLevel  aLevel = EAll 
)

Writes integer as a hex string to the debug log file.

Parameters
aHexInteger to be written as a hex string
aLevelPriority of logging - UI allows this to be set
Returns
Any EPOC error code
Return values
KErrNoneIf successful

◆ WriteLine() [1/2]

EXPORT_C TInt RSGEDebugLog::WriteLine ( const char *  aText,
TInt  aInt,
TLogLevel  aLevel = EAll 
)

Writes a line to the debug log file.

Parameters
aTextANSI text to write (can be string literal)
Integerto be written as string at the end of the line
Priorityof logging - UI allows this to be set
Returns
Any EPOC error code
Return values
KErrNoneIf successful
Parameters
aTextANSI text to write (can be string literal)
Integerto be written as hex string at the end of the line
Priorityof logging - UI allows this to be set
Returns
Any EPOC error code
Return values
KErrNoneIf successful

◆ WriteLine() [2/2]

EXPORT_C TInt RSGEDebugLog::WriteLine ( const char *  aText,
TLogLevel  aLevel = EAll 
)

Writes a line to the debug log file.

Parameters
aTextANSI text to write (can be string literal)
Priorityof logging - UI allows this to be set
Returns
Any EPOC error code
Return values
KErrNoneIf successful

The documentation for this class was generated from the following files: