Always use the project's standard logging system (mbgl::Log) with appropriate log levels instead of ad-hoc solutions like std::cout, printf, or custom logging macros. This ensures consistent log formatting, proper filtering, and integration with test frameworks.
Always use the project’s standard logging system (mbgl::Log) with appropriate log levels instead of ad-hoc solutions like std::cout, printf, or custom logging macros. This ensures consistent log formatting, proper filtering, and integration with test frameworks.
Key guidelines:
// Instead of:
// std::cout << "-------- HASTILE - FOUND IN TILES\n";
// or:
#if MLN_PLUGIN_LAYER_LOGGING_ENABLED
std::cout << "Working on: " << name << "\n";
#endif
// Use:
Log::Debug(Event::General, "HASTILE - FOUND IN TILES");
// or for errors:
Log::Error(Event::OpenGL, "Failed to open X display, retrying...");
if (!checkAndSetMode(Mode::Primitives)) {
Log::Warning(Event::Render, "Cannot add triangle with current mode");
return;
}
Be mindful that log levels can affect test behavior - some test fixtures may filter specific log levels.
Enter the URL of a public GitHub repository