-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Allow disabling logging by setting AUSTIN_NO_LOGGING in the environment #121
Conversation
👋 thanks for your contribution. This feature sounds interesting. I'm just curious, could you share with me your specific use case (while I figure out why the workflows are not running)? Also, it would be great if you could target the |
As for my use case, we're running several networked daemons written in Python that do a lot of marshaling/unmarshaling and database queries, and during certain events we're getting really unsatisfactory performance. It would be nice if I could attach austin in our production environment and obtain some samples to indicate where to optimize. However I don't want to spew syslog in our production environments with austin's logging. If austin could log to stderr and output samples to stdout then maybe that could work for me as well, but I thought it would be easiest to just disable logging altogether. |
@Mortal thanks for sharing your use case. Since this is a new feature, and in fact the first supported environment variable, we would need to:
As for the second entry in the list above, I would add the Environment Interface subsection under Usage in which we briefly say that some Austin behaviour can be configured via environment variables, and then add a table with the supported variables (just Also, just a heads-up that I might also ask you to rebase your branch on devel, once I push the GitHub Actions changes required to run on PRs. |
a62e0c3
to
49aa73f
Compare
@P403n1x87 I've rebased, updated the change-log and README, and added a test per your feedback. Please take another look. Also, it seems you need to give approval to run the workflows: |
Codecov Report
@@ Coverage Diff @@
## devel #121 +/- ##
==========================================
- Coverage 69.83% 69.71% -0.12%
==========================================
Files 22 22
Lines 2347 2351 +4
Branches 655 660 +5
==========================================
Hits 1639 1639
- Misses 411 414 +3
- Partials 297 298 +1
Continue to review full report at Codecov.
|
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.
Some small comments and suggestions, otherwise LGTM!
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.
🙌 thanks for your contribution!
Add a check in logging.c for the environment variable AUSTIN_NO_LOGGING. If it is nonempty, logging is disabled on all platforms.
Alternate Designs
None considered.
Regressions
No possible side-effects, as the odds of existing users inadvertently setting AUSTIN_NO_LOGGING are minimal.
Verification Process
To test (on Linux):
gcc -O3 -Os -Wall -pthread src/*.c -o src/austin
journalctl -f -t austin -n0
AUSTIN_NO_LOGGING=1 ./src/austin python3 -c 'import time; time.sleep(1)'
and observe that nothing is output to syslogAUSTIN_NO_LOGGING= ./src/austin python3 -c 'import time; time.sleep(1)'
and observe the usual output to syslog./src/austin python3 -c 'import time; time.sleep(1)'
and observe the usual output to syslog