Problem
Several log.Infof calls were used to print success/confirmation messages to the user (e.g. "Project deleted successfully", "Scanner updated successfully"). This is incorrect, log statements are controlled by log level, format, and destination, making CLI output unpredictable and inconsistent.
Change
- Audited all
log.Infof calls across pkg/api/ and cmd/
- User-facing confirmation messages →
fmt.Printf with \n
- Internal/intermediate log statements →
log.Debugf
- Removed unused
log imports where no log calls remain
Affected files
pkg/api/artifact_handler.go
pkg/api/project_handler.go
pkg/api/repository_handler.go
pkg/api/instance_handler.go
pkg/api/registry_handler.go
pkg/api/user_handler.go
cmd/harbor/root/scanner/update.go
cmd/harbor/root/scanner/delete.go
cmd/harbor/root/replication/policies/update.go
pkg/utils/utils.go
Problem
Several
log.Infofcalls were used to print success/confirmation messages to the user (e.g. "Project deleted successfully", "Scanner updated successfully"). This is incorrect, log statements are controlled by log level, format, and destination, making CLI output unpredictable and inconsistent.Change
log.Infofcalls acrosspkg/api/andcmd/fmt.Printfwith\nlog.Debugflogimports where no log calls remainAffected files
pkg/api/artifact_handler.gopkg/api/project_handler.gopkg/api/repository_handler.gopkg/api/instance_handler.gopkg/api/registry_handler.gopkg/api/user_handler.gocmd/harbor/root/scanner/update.gocmd/harbor/root/scanner/delete.gocmd/harbor/root/replication/policies/update.gopkg/utils/utils.go