Skip to content

Standardize logging to use logrus consistently across the repository#429

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/refactor-logging-style-again
Draft

Standardize logging to use logrus consistently across the repository#429
Copilot wants to merge 2 commits intomainfrom
copilot/refactor-logging-style-again

Conversation

Copy link

Copilot AI commented Feb 27, 2026

The mlflow package aliased logrus as log and used log.Printf/log.Println, while cmd/root.go used the stdlib log package. Both deviated from the established logrus.Levelf("component: action message") convention used everywhere else.

Changes

  • pkg/modelprovider/mlflow/downloader.go, provider.go: Replace log "github.com/sirupsen/logrus" alias with direct import. Convert all log.Printf/log.Println to appropriate logrus level calls (Infof, Debugf, Errorf, Warnf) with "mlflow:" component prefix.
  • cmd/root.go: Replace stdlib log.Fatallogrus.Fatal, drop unused "log" import.

Before/After

// before
log "github.com/sirupsen/logrus"
log.Printf("Start pull model from model registry with version %s", v)
log.Printf("Error listing objects: %v\n", err)
log.Printf("✅ Model downloaded")

// after
"github.com/sirupsen/logrus"
logrus.Infof("mlflow: starting pull model from registry with version %s", v)
logrus.Errorf("mlflow: failed to list objects: %v", err)
logrus.Infof("mlflow: model downloaded successfully")

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Replace log alias (log "github.com/sirupsen/logrus") in mlflow package
  with direct "github.com/sirupsen/logrus" import
- Convert all log.Printf/log.Println calls to proper logrus level methods
  (logrus.Infof, logrus.Debugf, logrus.Errorf, logrus.Warnf)
- Add consistent "mlflow:" prefix to all mlflow log messages matching the
  existing "component: action" pattern used across the backend package
- Replace stdlib log.Fatal with logrus.Fatal in cmd/root.go
- Remove unused stdlib "log" import from cmd/root.go

Co-authored-by: chlins <31262637+chlins@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor logging for consistent and standardized style Standardize logging to use logrus consistently across the repository Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants