ipkn/crow — pull request #2 by acron0 (2014-05-23 15:49:04+00:00)
Title: Added minimalist logging framework

Introducing logging.h:

Adds the following stream macros:
- CROW_LOG_CRITICAL
- CROW_LOG_ERROR
- CROW_LOG_WARNING
- CROW_LOG_INFO
- CROW_LOG_DEBUG

`CROW_LOG_INFO << server_name_ << " server is running, local port " << port_;`
(no need for endl, makes logging simpler)

Adds logging levels and the ability to set them:
`crow::logger::setLogLevel(LogLevel::INFO);`

Adds logging handler support, which redirects all log messages to a specified handler (crow::ILogHandler):

class ExampleLogHandler : public crow::ILogHandler {
public:
void log(string message, crow::LogLevel level) override {
cerr << "ExampleLogHandler -> " << message;
}
};

crow::logger::setHandler(std::make_shared());