Logging

Garvan ships two logging facilities: Crow's built-in CROW_LOG_* macros, and a small helper class Logger in vendors/Garvan/include/tools/Logger.h.

CROW_LOG_* macros

Crow's macros stream-style and respect a global level threshold:

CROW_LOG_DEBUG    << "incoming request: " << req.url;
CROW_LOG_INFO     << "user " << user_id << " logged in";
CROW_LOG_WARNING  << "deprecated endpoint hit";
CROW_LOG_ERROR    << "db connection failed: " << ex.what();
CROW_LOG_CRITICAL << "out of memory";

Garvan Logger

Use Logger inside service or model code when you don't have the Crow app reachable:

#include "tools/Logger.h"

Logger::info("indexing started");
Logger::error("could not open file: {}", path);

Log levels

Set the threshold at startup:

crow::logger::setLogLevel(crow::LogLevel::Warning);

Anything below Warning will be filtered out. In production you typically want Warning or Error; during development Debug is more useful.