Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labs cli remove verbose in favor of --loglevel + minor swig adjustments #4922

Merged
merged 5 commits into from
Jul 4, 2023

Conversation

jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented Jun 30, 2023

Pull request overview

  • Fixes #ISSUENUMBERHERE (IF THIS IS A DEFECT)

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified

@jmarrec jmarrec added component - CLI Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. component - Ruby bindings component - Python bindings labels Jun 30, 2023
@jmarrec jmarrec self-assigned this Jun 30, 2023
Copy link
Collaborator Author

@jmarrec jmarrec left a comment

Choose a reason for hiding this comment

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

Highlighted actual changes, the rest is just formatting noise

Comment on lines -103 to -114
auto* const verboseOpt = experimentalApp->add_flag_function(
"--verbose",
[](auto count) {
if (count == 1) {
fmt::print("Setting Log Level to Debug ({})\n", LogLevel::Debug);
openstudio::Logger::instance().standardOutLogger().setLogLevel(LogLevel::Debug);
} else if (count == 2) {
fmt::print("Setting Log Level to Trace ({})\n", LogLevel::Trace);
openstudio::Logger::instance().standardOutLogger().setLogLevel(LogLevel::Trace);
}
},
"Print the full log to STDOUT - sets verbosity to Debug if given once and Trace if given twice.");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actual change is here

Comment on lines +14 to +19
SWIGINTERN PyObject* SWIG_From_JsonValue(const Json::Value& value) {
// PyErr_WarnEx(PyExc_UserWarning, "Translating a Json::Value to a PyObject", 1); // Debugging

if (value.isNull()) {
return Py_None;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And here

Comment on lines +75 to +79
SWIGINTERN VALUE SWIG_From_JsonValue(const Json::Value& value) {

if (value.isNull()) {
return Qnil;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And here

@jmarrec jmarrec merged commit 79e9fe3 into develop Jul 4, 2023
5 of 6 checks passed
@jmarrec jmarrec deleted the labs_cli_remove_verbose branch July 4, 2023 13:22
@wenyikuang
Copy link
Collaborator

Just curios, why did we remove it?

@brianlball
Copy link
Contributor

whats the new equivalent of --verbose using the --loglevel stuff?

@jmarrec
Copy link
Collaborator Author

jmarrec commented Nov 17, 2023

We put it back. But --loglevel Debug is the equivalent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component - CLI component - Python bindings component - Ruby bindings Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants