logog
logger optimized for games
Verbosity levels of logging

During early stages of product development, you may want to spread DBUG() and INFO() type messages liberally across your code base in order to detect bugs earlier in the process. However, as your code develops you will want to omit these instructions entirely, as too many log messages will slow down your program.

To omit all logging messages of lower than a specific level at compilation time, #define the LOGOG_LEVEL constant to be some value from the following list:

#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

All logging macros of a lower level will be omitted.

You may enable all logging messages in the following manner before loading logog.hpp:

#define LOGOG_LEVEL LOGOG_LEVEL_ALL

And you may disable all logging messages with this before logog.hpp:

#define LOGOG_LEVEL LOGOG_LEVEL_NONE

The standard warnings apply to incrementing or changing variables within a macro. For example:

INFO("The core has exploded %d times", nExploded++);

The nExploded variable will only be incremented if LOGOG_LEVEL is set to LOGOG_LEVEL_INFO or lower.

In addition or alternately, you may dynamically change the logging level at run-time in your application by calling the SetDefaultLevel() function.