Skip to content

Debugging with Zap

ScriptCodex13 edited this page Jan 3, 2026 · 3 revisions

Debugging with Zap

Zap uses its own logging system to write debug messages, notifications, errors... to your console. Users of the Library can also use it for printing anything to the console.

For printing something to the console you can call this function you will need the Zap.h header for it

#include <Zap.h>

int main()
{
	messages::PrintMessage("Test", "Example.cpp", MessageTypes::api_core_info);          // green (never shows file)
	messages::PrintMessage("Test", "Example.cpp", MessageTypes::notification);           // white
	messages::PrintMessage("Test", "Example.cpp", MessageTypes::important_notification); // blue
	messages::PrintMessage("Test", "Example.cpp", MessageTypes::warning);		         // yellow
	messages::PrintMessage("Test", "Example.cpp", MessageTypes::error);                  // red
	messages::PrintMessage("Test", "Example.cpp", MessageTypes::fatal_error);            // dark red
}

And here is the result:

Output

You can see that the enums in the third paramter to specify the type of the message which changes the appearance of the message. And the first one determines the content of the message. The second argument is for printing out the orign of the error in our example the file "Example.cpp". If you don't want this to show up in your messages you can specify that in the fourth parameter (true = show, false = do not show).

If you want zap to dont show any of the debug messages you can use

ZAP_DISABLE_OUTPUTS(true) // true = disable | false = enable

Clone this wiki locally