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

Explicitly set verbosity from cxxopts value. #542

Merged
merged 1 commit into from Nov 8, 2022

Conversation

jshort
Copy link
Collaborator

@jshort jshort commented Oct 19, 2022

While investigating #541, I ran et with --verbose=9 but realized that the logs created by et and etterminal were not verbose. It turns out that the default argv parsing that easyloggingpp does via START_EASYLOGGINGPP(argc, argv) does not mesh well with the cxxopts style options so instead of relying on the default handling of argv/argc in ELPP, let's just explicitly set the verbose level from the cxxopts option argument. Note that a value greater than 9 defaults to 9 in ELPP so no handling in et/etterminal/etserver is required.

Examples of the discrepancies:

  • et --verbose=5 (cxxopts 5, ELPP 0)
    • ELPP doesn't check for long opt style arg values for --verbose (I have PR out for this)
  • et --verbose 5 (cxxopts 5, ELPP 9)
    • ELPP doesn't detect the arg for --verbose so sets to max verbosity
  • et -v 5 (cxxopts 5, ELPP 9)
    • ELPP doesn't detect the arg for -v so sets to max verbosity
  • et --v=5 (cxxopts exception, ELPP 5)
    • ELPP would accept this, but cxxopts fails since we don't have a
      'long' opt of v

@jshort
Copy link
Collaborator Author

jshort commented Oct 20, 2022

This will pass once #540 is merged and I rebase (vcpkg issue).

@MisterTea
Copy link
Owner

Please rebase and comment when it's passing.

While investigating MisterTea#541, I ran `et` with `--verbose=9` but realized
that the logs created by `et` and `etterminal` were not verbose.  It
turns out that the default argv parsing that easyloggingpp does via
START_EASYLOGGINGPP(argc, argv) does not mesh well with the cxxopts
style options so instead of relying on the default handling of argv/argc
in ELPP, let's just explicitly set the verbose level from the cxxopts
option argument.  Note that a value greater than 9 defaults to 9 in ELPP
so no handling in et/etterminal/etserver is required.

Examples of the discrepancies:

* `et --verbose=5` (cxxopts 5, ELPP 0)
** ELPP doesn't check for long opt style arg values for `--verbose` (I
have PR out for this)
* `et --verbose 5` (cxxopts 5, ELPP 9)
** ELPP doesn't detect the arg for --verbose so sets to max verbosity
* `et -v 5`        (cxxopts 5, ELPP 9)
** ELPP doesn't detect the arg for --verbose so sets to max verbosity
* `et --v=5`       (cxxopts exception, ELPP 5)
** ELPP would accept this, but cxxopts fails since we don't have a
'long' opt of `v`
@jshort
Copy link
Collaborator Author

jshort commented Nov 8, 2022

Please rebase and comment when it's passing.

@MisterTea all rebased! Thanks.

@MisterTea MisterTea merged commit 3b507db into MisterTea:master Nov 8, 2022
@jshort jshort deleted the verbosity_refactor branch December 7, 2022 22:34
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.

None yet

2 participants