Skip to content

Replace log.Infof user-facing output with fmt.Printf #883

@qcserestipy

Description

@qcserestipy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions