Skip to content
Peter Tissen edited this page Jun 27, 2014 · 3 revisions

How to log messages

The current logging system is controlled easiest with the comfort macros from Utilities/Log.h

LOG_SUCCESS(logType, text, ...)
LOG_NOTICE(logType, text, ...) 
LOG_WARNING(logType, text, ...)
LOG_ERROR(logType, text, ...)

The logType is of type Log::LogType which currently includes LOADER, MEMORY,RSX,HLE,PPU,SPU,TTY. text should be of type std::string or implicitly convertible to it.

The LOGF versions act like a printf call and use the same formatting specifiers.

If you don't want to repeat the log type all the time you can alias the log macros to always use the same type like #define MYLOG_WARN(text, ...) LOG_WARNING(HLE, text, ##__VA_ARGS__)

Examples

LOG_NOTICE(HLE, "doing stuff");
myType SPU; //ohoh
//if there's a local name that clashes with a log type, we just explicitly mention the namespace
LOG_WARNING(Log::SPU, "doing stuff"); 
LOG_ERROR(PPU, "did stuff with id: %d", 5);

Clone this wiki locally