Skip to content

Conversation

@goshanraj-g
Copy link

This PR fixes issue #390 by standardizing all log outputs to use a centralized Roast::Log class which acts as a facade over Roast::Helpers::Logger. This provides a consistent logging interface with these methods: info, debug, warn, error, and fatal.

Changes

  • Created log.rb: new logging facade w/ standardized methods
  • Updated roast.rb: replaced ~ 35 puts calls in CLI commands
  • Updated workflow components: replaced 50+ instances of $stderr.puts and $stdout.put across 16 workflow-related files w/ appropriate log levels:
    • Roast::Log.info for status messages and user-facing output
    • Roast::Log.warn for warnings and deprecation notices
    • Roast::Log.error for error conditions
    • Roast::Log.debug for verbose/debugging output
  • Created RuboCop cop: automatically detects and flags usage of puts, $stderr.puts, and $stdout.puts, and suggests Roast::Log alternatives
  • Updated .rubocop.yml: enables the new cop with appropriate exclusions for tests and examples

Copy link
Contributor

@nfgrep nfgrep left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Certainly a step in the right direction, but I'd rather see Roast::Helpers::Logger to go away entirely and be replaced by a Roast::Log, not just have a facade on top of it.

I'm also tempted to argue this falls out of our codefreeze, but I think a quick manual check that we still get logs out will do, so I'm fine to review an updated PR :)

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