BewareMyPower opened a new pull request #10031:
URL: https://github.com/apache/pulsar/pull/10031
### Motivation
For C++ client, if we want to see debug logs, there're two ways:
1. Build C++ library with CMake macro `-DUSE_LOG4CXX=ON`, and configure
`log4cxx.conf`.
2. Custom the logger factory for `Client`.
The first way needs log4cxx dependency that is not easy to install. It's
also why the `USE_LOG4CXX` option is disabled by default. The second way needs
a lot of extra code. Sometimes, we just want to set logger's default log level
to debug.
### Modifications
This PR exposes the internal `SimpleLoggerFactory` and support configure
debug level simply, for example
```c++
ClientConfiguration conf;
conf.setLogger(new SimpleLoggerFactory(Logger::LEVEL_DEBUG));
Client client("pulsar://localhost:6650", conf);
```
Add tests for the `Logger` created by `SimpleLoggerFactory::getLogger`.
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
This change added tests `CustomLoggerTest.testSimpleLoggerFactory`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]