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

Prevent the output of srt logs in utest. v5.0.181 v6.0.79 #3807

Merged
merged 3 commits into from
Sep 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions trunk/src/utest/srs_utest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ using namespace std;
#include <sys/mman.h>

#ifdef SRS_SRT
#include <srt/srt.h>
#include <srs_app_srt_server.hpp>
#endif

Expand All @@ -45,6 +46,14 @@ const char* _srs_binary = NULL;

#include <srs_app_st.hpp>

#ifdef SRS_SRT
static void srs_srt_utest_null_log_handler(void* opaque, int level, const char* file, int line,
winlinvip marked this conversation as resolved.
Show resolved Hide resolved
const char* area, const char* message)
{
// srt null log handler, do no print any log.
}
#endif

// Initialize global settings.
srs_error_t prepare_main() {
srs_error_t err = srs_success;
Expand Down Expand Up @@ -72,6 +81,9 @@ srs_error_t prepare_main() {
return srs_error_wrap(err, "srt log initialize");
}

// Prevent the output of srt logs in utest.
srt_setloghandler(NULL, srs_srt_utest_null_log_handler);

_srt_eventloop = new SrsSrtEventLoop();
if ((err = _srt_eventloop->initialize()) != srs_success) {
return srs_error_wrap(err, "srt poller initialize");
Expand Down