You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2019/06/12 01:18:27 UTC
[pulsar] branch master updated: C++ client build fails when
USE_LOG4CXX is ON (#4511)
This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new a96cb80 C++ client build fails when USE_LOG4CXX is ON (#4511)
a96cb80 is described below
commit a96cb803c99e3542d63c5f3e9d4178f98ba48654
Author: massakam <ma...@yahoo-corp.jp>
AuthorDate: Wed Jun 12 10:18:20 2019 +0900
C++ client build fails when USE_LOG4CXX is ON (#4511)
### Motivation
When I set `USE_LOG4CXX` to ON, C++ client build fails with the following error:
```
/tmp/apache-pulsar-2.3.2/pulsar-client-cpp/lib/ClientImpl.cc: In constructor ‘pulsar::ClientImpl::ClientImpl(const string&, const pulsar::ClientConfiguration&, bool)’:
/tmp/apache-pulsar-2.3.2/pulsar-client-cpp/lib/ClientImpl.cc:103:17: error: ‘Log4CxxLoggerFactory’ has not been declared
Log4CxxLoggerFactory::create(clientConfiguration_.getLogConfFilePath()));
```
This is because the header file `Log4CxxLogger.h` is not included in `ClientImpl.cc`.
### Modifications
Fixed `ClientImpl.cc` to include `Log4CxxLogger.h` only when `USE_LOG4CXX` is ON.
---
pulsar-client-cpp/lib/ClientImpl.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pulsar-client-cpp/lib/ClientImpl.cc b/pulsar-client-cpp/lib/ClientImpl.cc
index 0e996cc..18496db 100644
--- a/pulsar-client-cpp/lib/ClientImpl.cc
+++ b/pulsar-client-cpp/lib/ClientImpl.cc
@@ -35,6 +35,9 @@
#include <algorithm>
#include <regex>
#include <mutex>
+#ifdef USE_LOG4CXX
+#include "Log4CxxLogger.h"
+#endif
DECLARE_LOG_OBJECT()