#include <rda/ThreadedLogger.h>
#include <rda/LogStreamMacros.h>
int main(int argc, char* argv[]) {
ThreadedLoggerFactory threadedLoggerFactory(true);
rdaLogger::init(threadedLoggerFactory);
rdaLogger::setDefaultLevel(rdaLogger::LOG_ALL);
rdaLogger* logger = rdaLogger::getLogger("some.logger.name");
logger->setLevel(rdaLogger::LOG_ALL);
logger->error("An error message!");
logger->warning("A warning message!");
logger->info("An info message!");
logger->trace("A trace message!");
logger->debug("A debug message!");
if (logger->isLoggable(rdaLogger::LOG_DEBUG)) {
char msg[1000];
strcpy(msg, "A complicated and long message.");
logger->debug(msg);
}
int someValue = 5;
LOG_ERROR("some.logger.name.x", "An error value: " << someValue << "!" );
LOG_WARNING("some.logger.name.y", "A warning value: " << someValue << "!");
LOG_INFO("some.logger.name.z", "An info value: " << someValue << "!");
LOG_TRACE("some.logger.name.x", "A trace value: " << someValue << "!");
LOG_DEBUG("some.logger.name.x", "A debug value: " << someValue << "!");
rdaLogger::destroy();
return 0;
}