Allow undefining LOG macro with FairLogger v1.6.2+

Resolves #244
This commit is contained in:
Dennis Klein
2020-03-10 14:05:23 +01:00
committed by Alexey Rybalchenko
parent 0ae53fd7d9
commit 3d4cd02812
2 changed files with 30 additions and 23 deletions

View File

@@ -15,7 +15,6 @@
#include <asio/system_executor.hpp>
#include <chrono>
#include <exception>
#include <fairlogger/Logger.h>
#include <fairmq/sdk/Error.h>
#include <fairmq/sdk/Traits.h>
#include <functional>
@@ -24,6 +23,11 @@
#include <type_traits>
#include <utility>
#include <fairlogger/Logger.h>
#ifndef FAIR_LOG
#define FAIR_LOG LOG
#endif /* ifndef FAIR_LOG */
namespace fair {
namespace mq {
namespace sdk {
@@ -70,9 +74,9 @@ struct AsioAsyncOpImpl : AsioAsyncOpImplBase<SignatureArgTypes...>
try {
handler(ec, args...);
} catch (const std::exception& e) {
LOG(error) << "Uncaught exception in AsioAsyncOp completion handler: " << e.what();
FAIR_LOG(error) << "Uncaught exception in AsioAsyncOp completion handler: " << e.what();
} catch (...) {
LOG(error) << "Unknown uncaught exception in AsioAsyncOp completion handler.";
FAIR_LOG(error) << "Unknown uncaught exception in AsioAsyncOp completion handler.";
}
},
GetAlloc2());