-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] Add pulsar_logger_t as the configurable C logger (#162)
### Motivation The current `pulsar_client_configuration_set_logger` API can only configure the `Logger::log` method, but the` Logger::isEnabled` method cannot be configured via C API. #158 added a `pulsar_client_configuration_set_logger_and_level` function to configure a log level, but it's not flexible. For example, the log level might be modified dynamically (though it's a complicated case). ### Modifications Add a `pulsar_logger_t` struct and the related `pulsar_client_configuration_set_logger_t` function to configure it as the C logger API. The `is_enabled` and `log` fields of the struct are the responding methods of the `isEnabled` and `log` methods in C++ `Logger`. Then add a `LogContext` example in `SampleCustomLoggerCApi.c` to print logs to a file or standard output. Eliminate the `pulsar_client_configuration_set_logger_and_level` function.
- Loading branch information
1 parent
f3fc502
commit 8990b93
Showing
3 changed files
with
117 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters