Refactor logging, improve error handling workflow, clang-format. (#3385)

This commit is contained in:
Daniel Patterson
2016-12-06 12:30:46 -08:00
committed by GitHub
parent 6f4c6e84ae
commit 468d8c0031
62 changed files with 1778 additions and 1607 deletions
+3 -4
View File
@@ -6,7 +6,7 @@
#include "server/service_handler.hpp"
#include "util/integer_range.hpp"
#include "util/simple_logger.hpp"
#include "util/log.hpp"
#include <boost/asio.hpp>
#include <boost/bind.hpp>
@@ -36,8 +36,7 @@ class Server
static std::shared_ptr<Server>
CreateServer(std::string &ip_address, int ip_port, unsigned requested_num_threads)
{
util::SimpleLogger().Write() << "http 1.1 compression handled by zlib version "
<< zlibVersion();
util::Log() << "http 1.1 compression handled by zlib version " << zlibVersion();
const unsigned hardware_threads = std::max(1u, std::thread::hardware_concurrency());
const unsigned real_num_threads = std::min(hardware_threads, requested_num_threads);
return std::make_shared<Server>(ip_address, ip_port, real_num_threads);
@@ -62,7 +61,7 @@ class Server
acceptor.bind(endpoint);
acceptor.listen();
util::SimpleLogger().Write() << "Listening on: " << acceptor.local_endpoint();
util::Log() << "Listening on: " << acceptor.local_endpoint();
acceptor.async_accept(
new_connection->socket(),