CRM32Pro SDK  v5.22
List of all members | Public Member Functions
CRM32Pro_ILogSystem Class Reference

ILogSystem. More...

Detailed Description

ILogSystem.

Interface to log your application

Public Member Functions

unsigned char GetState (void)
 Get log system state. More...
 
void Halt ()
 Halt the log output.
 
void Init (char *filename, char mode, char level, char *prgname, char *author=NULL, char *email=NULL, char *web=NULL)
 Init LogSystem. More...
 
void Msg (char level, char *,...)
 Output a log message. More...
 
void ProfileBegin (char *name)
 Mark the begin of profile block. More...
 
void ProfileEnd (char *name)
 Mark the end of profile block. More...
 
void ProfileShow (void)
 Print to log system the samples results table.
 
void Resume ()
 Resume a previous halted log system.
 
void ShowTime (char)
 Print automatically the time when occurred the event each time you call to Msg(). More...
 

Member Function Documentation

unsigned char CRM32Pro_ILogSystem::GetState ( void  )

Get log system state.

Returns
0 log system is not activated
1 log system is activated
2 log system is halted(active but it needs a Resume())
void CRM32Pro_ILogSystem::Init ( char *  filename,
char  mode,
char  level,
char *  prgname,
char *  author = NULL,
char *  email = NULL,
char *  web = NULL 
)

Init LogSystem.

Parameters
filenamename of log file
modeLOG_NULL,LOG_CONSOLE,LOG_FILE,LOG_FILEAPPEND,LOG_DRTS. You can use logic OR to combine them.
levelLOG_LOW,LOG_NORMAL,LOG_HIGH
prgnamename of your program
authorauthor name (none by default)
emailemail of author (none by default)
webweb page of your project (none by default)
Examples:
Example01_BasicCode.cpp, Example03_GUI.cpp, Example05_VideoPlayer.cpp, Example08_SpriteCollision.cpp, Example09_LogicRenderRates.cpp, Example10_NetChat.cpp, Example11_NetChat2.cpp, Example12_DRTS.cpp, and SpacePong.cpp.
void CRM32Pro_ILogSystem::Msg ( char  level,
char *  format,
  ... 
)

Output a log message.

Parameters
levelset level requiered to log the message
formatformat parameter as printf function
Examples:
Example01_BasicCode.cpp, Example03_GUI.cpp, Example05_VideoPlayer.cpp, Example08_SpriteCollision.cpp, Example09_LogicRenderRates.cpp, Example10_NetChat.cpp, Example11_NetChat2.cpp, Example12_DRTS.cpp, and SpacePong.cpp.
void CRM32Pro_ILogSystem::ProfileBegin ( char *  name)

Mark the begin of profile block.

You must use the same name to mark the begin-end of desired block
These blocks can be nested.

Parameters
namename of your block.
void CRM32Pro_ILogSystem::ProfileEnd ( char *  name)

Mark the end of profile block.

You must use the same name to mark the begin-end of desired block
These blocks can be nested.

Parameters
namename of your block.
void CRM32Pro_ILogSystem::ShowTime ( char  m)

Print automatically the time when occurred the event each time you call to Msg().

By default it is disabled.
It only works with LOG_FILE or LOG_FILEAPPEND. It does not display any information to console system.

Parameters
m0 to disable it or any other value to enable it.

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