Skip to content

Standardize logging across codebase: levels, prefixes, and wording#429

Open
Copilot wants to merge 4 commits intomainfrom
copilot/refactor-logging-style-again
Open

Standardize logging across codebase: levels, prefixes, and wording#429
Copilot wants to merge 4 commits intomainfrom
copilot/refactor-logging-style-again

Conversation

Copy link

Copilot AI commented Feb 27, 2026

Logging was inconsistent across the repository — missing component prefixes, struct dumps at Info level, verbose boilerplate phrasing, and mixed wording styles.

Changes

  • Component prefixes: Added missing prefixes to all log calls (builder:, codec:, remote:, progress:)
  • Log level corrections: Moved config/struct dumps (%+v), digest calculations, cache hits, and metadata retrieval from Info → Debug
  • Concise wording: Replaced "starting X operation for" / "successfully X" boilerplate with direct verbs
  • Unified import style: Replaced log "github.com/sirupsen/logrus" alias and stdlib "log" with direct "github.com/sirupsen/logrus" imports
  • MLflow cleanup: Converted log.Printf/log.Println to proper logrus.Levelf calls with mlflow: prefix and appropriate levels

Pattern

// Before
logrus.Infof("push: starting push operation for target %s [config: %+v]", target, cfg)
logrus.Infof("push: processing layers for target %s [count: %d]", target, len(layers))
logrus.Infof("push: successfully pushed artifact %s", target)

// After
logrus.Infof("push: pushing artifact %s", target)
logrus.Infof("push: pushing %d layers for %s", len(layers), target)
logrus.Infof("push: pushed artifact %s", target)

23 files changed across pkg/backend/, pkg/codec/, pkg/backend/build/, pkg/backend/processor/, pkg/backend/remote/, pkg/modelprovider/mlflow/, internal/pb/, and cmd/.


💡 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
Copilot AI and others added 2 commits March 3, 2026 02:30
- Use concise, action-oriented messages (remove verbose "starting...operation" phrasing)
- Remove redundant "successfully" from completion messages (success is implied)
- Move config/struct dumps (%+v) from Info to Debug level
- Move internal operation details (digest calculation, cache hits, metadata) to Debug
- Add consistent component prefix to all logs (builder:, codec:, remote:, progress:)
- Use natural English phrasing (e.g., "pulling artifact" not "starting pull operation")
- Standardize wording patterns across all backend operations

Co-authored-by: chlins <31262637+chlins@users.noreply.github.com>
Address code review feedback: completion messages now use natural
"verb noun" order (e.g., "pushed artifact" not "artifact pushed")
for better readability and consistency with start messages.

Co-authored-by: chlins <31262637+chlins@users.noreply.github.com>
Copilot AI changed the title Standardize logging to use logrus consistently across the repository Standardize logging across codebase: levels, prefixes, and wording Mar 3, 2026
Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@chlins chlins marked this pull request as ready for review March 3, 2026 02:45
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