-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add --quiet flag to suppress log spam #26
base: master
Are you sure you want to change the base?
Conversation
Suppresses "Supervising n threads...", "Successfully made thread RT", and "Successfully demoted thread" messages.
@@ -857,7 +865,7 @@ static void reset_known(void) { | |||
if (verify_process_user(u, p) >= 0 && | |||
verify_process_starttime(p) >= 0 && | |||
verify_thread_starttime(p, t) >= 0) | |||
if (thread_reset(t->pid) >= 0) { | |||
if (thread_reset(t->pid) >= 0 && !log_quiet) { |
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.
The additional log_quiet
check here may cause n_demoted++
to be erroneously skipped, affecting a log message which is still issued below:
syslog(LOG_NOTICE, "Demoted %u threads.\n", n_demoted)
@@ -951,7 +959,7 @@ static int reset_all(void) { | |||
|
|||
if (r == SCHED_FIFO || r == SCHED_RR || | |||
r == (SCHED_FIFO|SCHED_RESET_ON_FORK) || r == (SCHED_RR|SCHED_RESET_ON_FORK)) | |||
if (thread_reset((pid_t) tid) >= 0) { | |||
if (thread_reset((pid_t) tid) >= 0 && !log_quiet) { |
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.
Same issue as above
This PR has been open for almost a year. Is there anything preventing its merge? |
Alternative solution for |
Thanks, i'm also using the following, which eliminates the IMHO this setting, in the drop-in, should be shipped by default, which would eliminate the need for this PR 🖖
|
This pull request adds a --quiet flag to suppress log spam, fixing #22 (which has been noted by many others for the last decade). Specifically, it suppresses three types of messages:
"Supervising _ threads of _ processes of _ users."
"Successfully made thread _ of process _ owned by _ high priority at nice level _."
"Successfully demoted thread _ of process _."
These messages (especially the first two) are responsible for an annoyingly large amount of journal spam. It is convenient to have the ability to turn them off, but I have made no changes to the default behavior.