internal/httpcli: remove log15, add NewLoggingMiddleware to enable logs
requested to merge 08-28-internal/httpcli_remove_log15_add_NewLoggingMiddleware_to_explicitly_add_logs into main
Created by: bobheadxi
Removes log15 usages from internal/httpcli
, and removes an improper pre-package-initialization usage of log.Scoped
. This means that we cannot provided a package-level, out-of-the-box-logged httpcli.Doer
implementation - instead, we make logging opt-in with NewLoggingMiddleware
, and replace existing logging with either:
- Set desired metadata into context for logging middleware to pick up
- Log in trace instead
To enable easier inclusion of logging, the default client factory constructors have been updated to accept a set of Middleware
, which can include the new logging middleware.
We also add the new logging middleware to a variety of callsites that used to use ExternalClientFactory
or NewExternalClientFactory
.
Test plan
sg start
, unit tests, existing tests pass