Log Levels and Tracing APIs

The MBOLogger class enables the client to add log levels to messages reported to the console.The application can set the log level using the setLogLevel method.

In ascending order of detail (or descending order of severity), the log levels defined are LOG_OFF (no logging), LOG_FATAL, LOG_ERROR, LOG_WARN, LOG_INFO, and LOG_DEBUG.

Macros such as MBOLogError, MBOLogWarn, and MBOLogInfo allow application code to write console messages at different log levels. You can use the method setLogLevel to determine which messages get written to the console. For example, if the application sets the log level to LOG_WARN, calls to MBOLogInfo and MBOLogDebug do not write anything to the console.

[MBOLogger setLogLevel:LOG_INFO];
MBOLogInfo(@"This log message will print to the consoleā€);
[MBOLogger setLogLevel:LOG_WARN];
MBOLogInfo(@"This log message will not print to the console");
MBOLogError(@"This log message will print to the console");