hetznercloud / hcloud-go

A Go library for the Hetzner Cloud API
https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud
MIT License
371 stars 45 forks source link

feat: allow using custom debug write functions #506

Open jooola opened 1 month ago

jooola commented 1 month ago

Allow to configure custom functions to write the request/response debug logs.

jooola commented 1 month ago

We might want to make this configurable, e.g. we have a difference between the terraform logs and our CLI.

Maybe using a logging library is easier?

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 74.19355% with 8 lines in your changes missing coverage. Please review.

Project coverage is 71.50%. Comparing base (468234e) to head (99246d1).

Files Patch % Lines
hcloud/client.go 50.00% 4 Missing :warning:
hcloud/client_handler.go 0.00% 1 Missing and 1 partial :warning:
hcloud/client_handler_debug.go 90.47% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #506 +/- ## ========================================== + Coverage 71.46% 71.50% +0.04% ========================================== Files 46 46 Lines 3935 3959 +24 ========================================== + Hits 2812 2831 +19 - Misses 710 714 +4 - Partials 413 414 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.