Skip to content

Log warnings and errors to stderr instead of stdout#5213

Open
jackkoenig wants to merge 3 commits intomainfrom
jackkoenig/errors-to-stderr
Open

Log warnings and errors to stderr instead of stdout#5213
jackkoenig wants to merge 3 commits intomainfrom
jackkoenig/errors-to-stderr

Conversation

@jackkoenig
Copy link
Contributor

This has bothered me for a very long time. I'm wondering if this is fine on a minor version or should wait for Chisel 8...

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • API deprecation
  • Bugfix

Desired Merge Strategy

  • Squash

Release Notes

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • Did you mark the proper milestone (Bug fix: 3.6.x, 5.x, or 6.x depending on impact, API modification or big change: 7.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash) and clean up the commit message.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

@jackkoenig jackkoenig added the Deprecation Deprecates an API, will be included in release notes label Feb 24, 2026
@jackkoenig jackkoenig requested a review from seldridge February 24, 2026 22:41
Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

This generally makes sense to me. I think it is defensible to send logs to stdout if the tool never uses stdout for anything. However, we should be using stdout for the output FIRRTL or Verilog.

This would make Chisel much closer to a command line generator than the file-based thing that it is now. 👍

Comment on lines +218 to +219
case LogLevel.Error | LogLevel.Warn => state.errorStream
case _ => state.stream
Copy link
Member

Choose a reason for hiding this comment

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

I'd say put everything into errorStream. This would level Info and Debug going to stdout right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah currently I'm having it send Warn and Error to stderr and the others to stdout, your point is a good one though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Deprecation Deprecates an API, will be included in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants