-
Notifications
You must be signed in to change notification settings - Fork 55
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
A switch to disable logging in optimized builds #1125
Conversation
564e9b8
to
86a01db
Compare
Codecov Report
@@ Coverage Diff @@
## master #1125 +/- ##
==========================================
+ Coverage 83.47% 83.48% +0.01%
==========================================
Files 81 82 +1
Lines 29755 29800 +45
==========================================
+ Hits 24838 24879 +41
- Misses 4917 4921 +4
Continue to review full report at Codecov.
|
48475a8
to
aa8d6ef
Compare
@rrrooommmaaa Looks good once tests are passing (Seems this breaks CLI Keystore test). |
Same as @ni4 -- @rrrooommmaaa can we fix the tests and get this merged? Thanks. |
a1710a1
to
9bc6157
Compare
@ni4 This update builds ok on most systems, but triggers this error on Cyrrus CI: |
@rrrooommmaaa My guess is that it is related to EFL dynamic symbols export and could be fixed with |
dd27731
to
ebe0166
Compare
@dewyatt @ni4 @ronaldtse @joke325 @antonsviridenko I would appreciate some help/opinion here.
|
@rrrooommmaaa Did you try to use getter/setter function instead of accessing variable directly? P.S. And, as a side note - could you please slightly rebase on master/squash commits since it looks crazy in GUI Git client. |
05d3357
to
cc5a4e6
Compare
Edited and rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Just got an idea that at some point later we can update this with FFI function rnp_set_log_fd()
, so logging could be redirected to some file/pipe/whatever else (or to -1 to disable it).
src/lib/misc.cpp
Outdated
{ | ||
if (_rnp_log_switch < 0) { | ||
const char *var = getenv(RNP_LOG_CONSOLE); | ||
_rnp_log_switch = !!var; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to support RNP_LOG_CONSOLE=0
instead of just checking for the presence of the env var. Sometimes it's easier to override an env var than it is to unset it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree! Let's update this and merge!
cc5a4e6
to
af99f84
Compare
Closes #1103