swift/swift
Tim Burke b447234b2f Allow StatsdClients to no-op if no host provided
We've been working toward separating our logger from our statsd client.
This is generally a good idea; it's always been a little weird to have
our special-case loggers that would allow you to *also* increment some
counters.

The end goal is to take a bunch of places that look like

    logger = utils.get_logger(conf)
    ...
    logger.info(...)
    logger.increment(...)

and turn them into something more like

    logger = logs.get_adapted_logger(conf)
    stats = statsd_client.get_statsd_client(conf, logger=logger)
    ...
    logger.info(...)
    stats.increment(...)

Take a lesson from logging: callers don't need to know whether the
log_level is high enough that their message will be logged, or even
whether logging is enabled at all. Code wanting to emit stats shouldn't
need to know whether statsd collection has been configured, either.

Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: I6eb5b27a387cc2b7310ee11cc49d38fd2b6cbab8
2024-05-17 13:49:03 -05:00
..
account Remove per-service auto_create_account_prefix 2023-11-22 01:58:03 +09:00
cli recon-cron: Tolerate missing directories 2024-03-21 14:10:14 -07:00
common Allow StatsdClients to no-op if no host provided 2024-05-17 13:49:03 -05:00
container sharding: don't replace own_shard_range without an epoch 2024-02-07 13:37:58 -08:00
locale Imported Translations from Zanata 2023-06-28 02:13:42 +00:00
obj support x-open-expired header for expired objects 2024-04-26 10:13:40 +01:00
proxy Use ClosingMapper to ensure prompt client disconnect logging 2024-05-07 09:19:33 -07:00
__init__.py Switch from pkg_resources to importlib 2023-01-31 15:41:48 -08:00