Skip to content

Commit

Permalink
refactor: Use debug prints only when debug mode is enabled (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
adeatcu-ionos authored Aug 29, 2024
1 parent 535d733 commit 5185e01
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
16 changes: 8 additions & 8 deletions products/containerregistry/api_repositories.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions shared/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ func (resp *APIResponse) HttpNotFound() bool {
// does not print anything for nil APIResponse values
func (resp *APIResponse) LogInfo() {

if resp != nil {
SdkLogger.Printf("[DEBUG] Request time : %s for operation : %s",
resp.RequestTime, resp.Operation)
if resp.Response != nil {
SdkLogger.Printf("[DEBUG] response status code : %d\n", resp.StatusCode)
if SdkLogLevel.Satisfies(Debug) {
if resp != nil {
SdkLogger.Printf("[DEBUG] Request time: %s for operation: %s",
resp.RequestTime, resp.Operation)
if resp.Response != nil {
SdkLogger.Printf("[DEBUG] response status code: %d\n", resp.StatusCode)
}
}
}
}

0 comments on commit 5185e01

Please sign in to comment.