-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Logger #369
Introduce Logger #369
Conversation
Log(...interface{}) | ||
} | ||
|
||
func NewDefaultLogger() Logger { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function NewDefaultLogger should have comment or be unexported
@QuentinPerez thanks for improving the PR! If you have other changes in mind let me know; also if you want to have the commits squashed or rebased, to conform commit msg guidelines. |
LGTM, ping @moul 😊 |
LGTM, thank you |
Well done guys |
@QuentinPerez can you credit @nicolai86 in the changelog ? |
Thanks for being so responsive! I'll continue my quest to get scaleway into terraform, then. 🙏🏼 |
For those interested in the progress of the terraform provider, you can take a look here: hashicorp/terraform#7331 |
Following #368 this PR introduces a
Logger
interface which allows us to extract thehttp2curl
andlogrus
dependencies into thecli
&command
packages.The
Logger
contains two functions -LogHTTP
to handlehttp.Request
, andLog
for plainstring
.The
cli
configures theScalewayAPI
instance to retain the old logging behaviour. By default, the logging is not very verbose, logging only messages & API endpoints being used.Also, I've replaced
anonuuid
with static, fake uuids. Not sure why we need "randomized" uuids if the only concern is to sanitize logs from real credentials.