Skip to content

Commit dc6a062

Browse files
committed
Deprecated LogConfFilePath config.
1 parent f50bdb6 commit dc6a062

File tree

5 files changed

+4
-6
lines changed

5 files changed

+4
-6
lines changed

pulsar/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ def __init__(self, service_url,
426426
Number of concurrent lookup-requests allowed on each broker connection to prevent overload
427427
on the broker.
428428
log_conf_file_path: str, optional
429+
This parameter is deprecated. Use logger instead.
429430
Initialize log4cxx from a configuration file.
430431
use_tls: bool, default=False
431432
Configure whether to use TLS encryption on the connection. This setting is deprecated.
@@ -459,6 +460,8 @@ def __init__(self, service_url,
459460
_check_type(bool, tls_allow_insecure_connection, 'tls_allow_insecure_connection')
460461
_check_type(bool, tls_validate_hostname, 'tls_validate_hostname')
461462
_check_type_or_none(str, listener_name, 'listener_name')
463+
if log_conf_file_path is not None:
464+
logging.warning("log_conf_file_path is deprecated, will ignore setting it. Use logger instead.")
462465

463466
conf = _pulsar.ClientConfiguration()
464467
if authentication:
@@ -468,8 +471,6 @@ def __init__(self, service_url,
468471
conf.io_threads(io_threads)
469472
conf.message_listener_threads(message_listener_threads)
470473
conf.concurrent_lookup_requests(concurrent_lookup_requests)
471-
if log_conf_file_path:
472-
conf.log_conf_file_path(log_conf_file_path)
473474

474475
if isinstance(logger, logging.Logger):
475476
conf.set_logger(self._prepare_logger(logger))

src/config.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ void export_config(py::module_& m) {
156156
.def("concurrent_lookup_requests", &ClientConfiguration::getConcurrentLookupRequest)
157157
.def("concurrent_lookup_requests", &ClientConfiguration::setConcurrentLookupRequest,
158158
return_value_policy::reference)
159-
.def("log_conf_file_path", &ClientConfiguration::getLogConfFilePath, return_value_policy::copy)
160-
.def("log_conf_file_path", &ClientConfiguration::setLogConfFilePath, return_value_policy::reference)
161159
.def("use_tls", &ClientConfiguration::isUseTls)
162160
.def("use_tls", &ClientConfiguration::setUseTls, return_value_policy::reference)
163161
.def("tls_trust_certs_file_path", &ClientConfiguration::getTlsTrustCertsFilePath,

tests/_trial_temp/_trial_marker

Whitespace-only changes.

tests/_trial_temp/test.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-08-10 22:23:23+0800 [-] Log opened.

tests/pulsar_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,6 @@ def test_client_argument_errors(self):
773773
self._check_value_error(lambda: Client(self.serviceUrl, io_threads="test"))
774774
self._check_value_error(lambda: Client(self.serviceUrl, message_listener_threads="test"))
775775
self._check_value_error(lambda: Client(self.serviceUrl, concurrent_lookup_requests="test"))
776-
self._check_value_error(lambda: Client(self.serviceUrl, log_conf_file_path=5))
777776
self._check_value_error(lambda: Client(self.serviceUrl, use_tls="test"))
778777
self._check_value_error(lambda: Client(self.serviceUrl, tls_trust_certs_file_path=5))
779778
self._check_value_error(lambda: Client(self.serviceUrl, tls_allow_insecure_connection="test"))
@@ -1407,7 +1406,6 @@ def _do_connect(close):
14071406
io_threads=4,
14081407
message_listener_threads=4,
14091408
operation_timeout_seconds=1,
1410-
log_conf_file_path=None,
14111409
authentication=None,
14121410
logger=logger,
14131411
)

0 commit comments

Comments
 (0)