This is a header only lightweight logging library implemented using code from http://www.drdobbs.com/cpp/a-lightweight-logger-for-c/240147505 with some modifications.
- Easy to use Macros
- Easy to enable/disable with definitions
- Include log file policy to write log to text file
- Interface class for custom log file policies
- Multiple log file policy support
Please see the included main.cpp for examples of the following information.
LOG_INITthis macro initializes the Logger objectLOG_INSTprovides a symbol to the same Logger object (as long as you're in the same scope)LOG,LOG_ERR,LOG_WARNexpands to a method call which will print the parametes in the parentesis that follow the macro e.g.LOG("log something...");LOGGING_LEVEL_1,LOGGING_LEVEL_2,LOGGING_LEVEL_3These define the level or detail that is logged. They are:- Only
LOG_WARNmessages are expanded LOG_WARNandLOG_ERRare expandedLOG_WARN,LOG_ERROR, andLOGare expanded
- Only
Just to say again, original credit for the code goes to Filip Janiszewski's post on drdobbs.com