We would like to remove any Statsd related code from logs.py. That requires that SwiftLogAdapter no longer provides a StatsdClient interface by default. However, for backwards compatibility the main utils.get_logger/get_prefixed_logger entrypoints must provide a SwiftLogAdapter that does have a StatdsClient interface. The new utils._patch_statsd_methods helper function is therefore used to retrospectively patch a SwiftLogAdapter instance with the StatsdClient interface when necessary. The _patch_statsd_helper is used in get_logger, and again when we clone a logger in get_prefixed_logger. Co-Authored-By: Shreeya Deshpande <shreeyad@nvidia.com> Change-Id: I44694b92264066ca427bb96456d6f944e09b31c0
36 KiB
36 KiB