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
..
2024-03-14 20:45:47 -07:00
2024-03-12 13:48:02 +00:00
2023-01-19 12:56:08 -08:00
2020-05-15 22:38:04 -07:00