Skip to content

Commit

Permalink
global: always disable log to stderr when redirected to /dev/null
Browse files Browse the repository at this point in the history
It will be discarded anyway.

Signed-off-by: 胡玮文 <[email protected]>
  • Loading branch information
huww98 committed Aug 6, 2022
1 parent 7e1fb01 commit 877f778
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/global/global_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,7 @@ void global_init_chdir(const CephContext *cct)
int global_init_shutdown_stderr(CephContext *cct)
{
reopen_as_null(cct, STDERR_FILENO);
int l = cct->_conf->err_to_stderr ? -1 : -2;
cct->_log->set_stderr_level(l, l);
cct->_log->set_stderr_level(-2, -2);
return 0;
}

Expand Down

0 comments on commit 877f778

Please sign in to comment.