Implement logging abstraction (#371)

Fixes #290
This commit is contained in:
Alex Kremer
2022-11-17 23:02:16 +01:00
committed by GitHub
parent 4b8dd7b981
commit a47bf2e8fe
38 changed files with 1441 additions and 1003 deletions

View File

@@ -3,9 +3,11 @@
#include <backend/BackendInterface.h>
#include <config/Config.h>
#include <memory>
#include <log/Logger.h>
#include <subscriptions/Message.h>
#include <memory>
class WsBase;
class Subscription
@@ -87,6 +89,7 @@ public:
class SubscriptionManager
{
using session_ptr = std::shared_ptr<WsBase>;
clio::Logger log_{"Subscriptions"};
std::vector<std::thread> workers_;
boost::asio::io_context ioc_;
@@ -134,8 +137,8 @@ public:
// We will eventually want to clamp this to be the number of strands,
// since adding more threads than we have strands won't see any
// performance benefits
BOOST_LOG_TRIVIAL(info) << "Starting subscription manager with "
<< numThreads << " workers";
log_.info() << "Starting subscription manager with " << numThreads
<< " workers";
workers_.reserve(numThreads);
for (auto i = numThreads; i > 0; --i)