diff options
author | Craig Tiller <ctiller@google.com> | 2016-11-04 16:01:23 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-11-04 16:01:23 -0700 |
commit | 194b23856aa7251ad99df62134ab0301c5a37a5d (patch) | |
tree | a6c2c05cecae62171fccffafdf7adc1ba90d4846 /test/core/end2end/tests/no_logging.c | |
parent | 40c8fba13c7cbed7df5f92b3bab4131178410ccd (diff) | |
parent | 80eb075e633219cf8972e778eb449d2271ee92ad (diff) |
Merge github.com:grpc/grpc into decouple_version_number
Diffstat (limited to 'test/core/end2end/tests/no_logging.c')
-rw-r--r-- | test/core/end2end/tests/no_logging.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/test/core/end2end/tests/no_logging.c b/test/core/end2end/tests/no_logging.c index 3c40e5dbac..1d3cfda6e5 100644 --- a/test/core/end2end/tests/no_logging.c +++ b/test/core/end2end/tests/no_logging.c @@ -68,6 +68,13 @@ static void test_no_error_log(gpr_log_func_args *args) { } } +static gpr_atm g_log_func = (gpr_atm)gpr_default_log; + +static void log_dispatcher_func(gpr_log_func_args *args) { + gpr_log_func log_func = (gpr_log_func)gpr_atm_no_barrier_load(&g_log_func); + log_func(args); +} + static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, const char *test_name, grpc_channel_args *client_args, @@ -263,12 +270,12 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { static void test_no_error_logging_in_entire_process( grpc_end2end_test_config config) { int i; - gpr_set_log_function(test_no_error_log); + gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)test_no_error_log); for (i = 0; i < 10; i++) { test_invoke_simple_request(config); } test_invoke_10_simple_requests(config); - gpr_set_log_function(gpr_default_log); + gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)gpr_default_log); } static void test_no_logging_in_one_request(grpc_end2end_test_config config) { @@ -278,16 +285,20 @@ static void test_no_logging_in_one_request(grpc_end2end_test_config config) { for (i = 0; i < 10; i++) { simple_request_body(f); } - gpr_set_log_function(test_no_log); + gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)test_no_log); simple_request_body(f); - gpr_set_log_function(gpr_default_log); + gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)gpr_default_log); end_test(&f); config.tear_down_data(&f); } void no_logging(grpc_end2end_test_config config) { + gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG); + grpc_tracer_set_enabled("all", 0); + gpr_set_log_function(log_dispatcher_func); test_no_logging_in_one_request(config); test_no_error_logging_in_entire_process(config); + gpr_set_log_function(gpr_default_log); } void no_logging_pre_init(void) {} |