goharbor / goharbor/harbor-cli
[feature]: clean up `log.Info` / `log.Debug`
- Dominant language
- Go
- Stars
- 163
- Forks
- 211
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
## Audit and clean up `log.Info` / `log.Debug` usage across the codebase
### Summary
User-facing confirmation messages (success/status output) should go through `fmt.Printf`, not `log.Infof`. Log statements are for structured logging and debug output, mixing them with CLI output makes the output behavior unpredictable (depends on log level, log format, log destination).
This is a tracking issue to ensure all `log.Info` and `log.Debug` statements are reviewed and classified.
### Rules
| Statement | When to use |
|-----------|-------------|
| `fmt.Printf` / `fmt.Println` | User-facing output: success confirmations, status updates |
| `log.Debugf` | Internal steps useful for debugging, not shown by default |
| `log.Infof` | Should generally not be used for CLI output |
| `log.Errorf` | Shall not be used anymore and will be retired by #635 |
### Tasks
- [ ] Audit all remaining `log.Infof` calls, classify as user-facing or debug, #883
- [ ] Audit all `log.Debugf` calls, verify they are actually debug-relevant
Contributor guide
Assessment
This issue has not been assessed yet.