Skip to content

Cleanup output streams in GridKit core code - #599

Merged
nkoukpaizan merged 14 commits into
developfrom
nicholson/cleanup-output-streams
Oct 1, 2026
Merged

nkoukpaizan merged 14 commits into
developfrom
nicholson/cleanup-output-streams

Conversation

@nkoukpaizan

@nkoukpaizan nkoukpaizan commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This updates most of the output streams in the GridKit folder to use the Logger instead of std::cout/std::cerr.
Closes #512

Proposed changes

  • Introduced GRIDKIT_ENABLE_DEVELOPER_MODE, that currently increases the default verbosity. I envision using this for other purposes than verbosity levels.
  • Introduced Logger::raiseVerbosity to prevent unintentionally lowering verbosity in applications and examples.
  • Replaced the std::cout/std::cerr calls I think are worth keeping.
  • Replaced most std::endl with "\n".
  • Removed commented out std::cout/std::cerr that only reported "tracing/debugging" information.

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • [N/A] There are unit tests for the new code.
  • [N/A] The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • The CHANGELOG.md has been updated to reflect the changes. If this is a minor PR that is part of a larger fix already included in the file, state so.

Further comments

We can either squeeze this in before #596 or defer to after the release.

@nkoukpaizan nkoukpaizan self-assigned this Sep 30, 2026
@nkoukpaizan
nkoukpaizan marked this pull request as ready for review September 30, 2026 22:51

@lukelowry lukelowry left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Very helpful thank you for the developer mode flag

@pelesh

pelesh commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the much needed cleanup!

What is the difference between setVerbosity and raiseVerbosity? It is not clear to me why we can't use setVerbosity only.

@pelesh

pelesh commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

CC @Steven-Roberts @alexander-novo

@nkoukpaizan

Copy link
Copy Markdown
Collaborator Author

Thanks for the much needed cleanup!

What is the difference between setVerbosity and raiseVerbosity? It is not clear to me why we can't use setVerbosity only.

The difference is asserting that the target verbosity is higher than the previous one. We could use setVerbosity only, but that puts the burden on the caller to check.

Comment thread GridKit/Model/PowerFlow/MatpowerParser.hpp
@nkoukpaizan
nkoukpaizan merged commit c64d0e1 into develop Oct 1, 2026
6 checks passed
@nkoukpaizan
nkoukpaizan deleted the nicholson/cleanup-output-streams branch October 1, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup and harmonize output streams

4 participants