Skip to content

internal/httpcli: remove log15, add NewLoggingMiddleware to enable logs

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:

  1. Set desired metadata into context for logging middleware to pick up
  2. 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

Merge request reports

Loading