The logging functionality found in Cogs::Logging can be used to gather output from your program and pipe it through a controlled interface.
To use logging the developer must:
- Include the logging headers.
- Create a logger instance
- Use the appropriate methods, or preferably the logging macros provided.
#include <Foundation/Logging/Logger.h>
namespace
{
void printfCallback(const char * message, const char * source, int category)
{
printf("[%d][%s][%s]", category, source, message);
}
}
int main()
{
Cogs::Logging::setLoggerCallback(printfCallback);
LOG_INFO(log,
"Some numeric info: %d", 123);
...
}
#define LOG_INFO(logInstance,...)
Definition: Logger.h:18
#define LOG_DEBUG(logInstance,...)
Definition: Logger.h:14
Log implementation class.
Definition: LogManager.h:139
constexpr Log getLogger(const char(&name)[LEN]) noexcept
Definition: LogManager.h:180