logog
logger optimized for games
Logging events in your code

In order to log events in your code, it's important to first understand the logging levels that are available to you. Out of the box, logog comes with these logging levels, which are compatible with the syslog standard:

#define LOGOG_LEVEL_NONE 0
#define LOGOG_LEVEL_EMERGENCY 8
#define LOGOG_LEVEL_ALERT 16
#define LOGOG_LEVEL_CRITICAL 24
#define LOGOG_LEVEL_ERROR 32
#define LOGOG_LEVEL_WARN 40
#define LOGOG_LEVEL_WARN1 48
#define LOGOG_LEVEL_WARN2 56
#define LOGOG_LEVEL_WARN3 64
#define LOGOG_LEVEL_INFO 72
#define LOGOG_LEVEL_DEBUG 80
#define LOGOG_LEVEL_ALL 88

So, the lower the level number is, the more important the logging message is.

To log an event in your code, there exists macros for each of the logging levels. So, for example, to log an event of level WARN3, you would use the following macro in your code:

LOGOG_WARN3("Disk reads are taking %d milliseconds to complete!", nMilliseconds );

It can get laborious to type the LOGOG_ prefix on all log messages, so, if the LOGOG_USE_PREFIX macro is not defined, you may use these shorter alternate logging forms:

#define DBUG(...) LOGOG_DEBUG( __VA_ARGS__ )
#define INFO(...) LOGOG_INFO( __VA_ARGS__ )
#define WARN3(...) LOGOG_WARN3( __VA_ARGS__ )
#define WARN2(...) LOGOG_WARN2( __VA_ARGS__ )
#define WARN1(...) LOGOG_WARN1( __VA_ARGS__ )
#define WARN(...) LOGOG_WARN( __VA_ARGS__ )
#define ERR(...) LOGOG_ERROR( __VA_ARGS__ )
#define ALERT(...) LOGOG_ALERT( __VA_ARGS__ )
#define CRITICAL(...) LOGOG_CRITICAL( __VA_ARGS__ )
#define EMERGENCY(...) LOGOG_EMERGENCY( __VA_ARGS__ )

If you want to generate a log message of some user-specified level, check out the LOGOG_LEVEL_MESSAGE macro.

Keep in mind that you must instantiate at least one Target object in your application for log messages to have any effect.