Manapi Http

System Logs

Setting Up System Logging

ManapiHttp provides 5 levels of system logging:

  • LOG_TRACE_NONE - No debug output

  • LOG_TRACE_HIGH - Only critical messages will be printed

  • LOG_TRACE_MEDIUM - Some less important messages will also be printed

  • LOG_TRACE_LOW -Almost all messages will be printed

  • LOG_TRACE_HARD - All debug messages will be printed, including messages from TimerLoop, EventLoop, TCP and UDP

Note

In release mode, messages with the LOG_TRACE_HARD level are removed.

#include <manapihttp/ManapiInitTools.hpp> // manapi::init_tools::log_trace_init
#include <manapihttp/ManapiDebug.hpp> // manapi_log_trace
 
int main(int argc, char *argv[]) {
    // System log initialization (not thread-safe)
    manapi::init_tools::log_trace_init(manapi::debug::LOG_TRACE_HIGH);
    // Print message (method is blocking and thread-safe)
    manapi_log_trace(manapi::debug::LOG_TRACE_HIGH, "Application has started!");
}