src/core/lib/gpr/log.cc in grpc-flamingo-1.11.0 vs src/core/lib/gpr/log.cc in grpc-flamingo-1.15.0
- old
+ new
@@ -42,13 +42,19 @@
return "E";
}
GPR_UNREACHABLE_CODE(return "UNKNOWN");
}
+int gpr_should_log(gpr_log_severity severity) {
+ return static_cast<gpr_atm>(severity) >=
+ gpr_atm_no_barrier_load(&g_min_severity_to_print)
+ ? 1
+ : 0;
+}
+
void gpr_log_message(const char* file, int line, gpr_log_severity severity,
const char* message) {
- if (static_cast<gpr_atm>(severity) <
- gpr_atm_no_barrier_load(&g_min_severity_to_print)) {
+ if (gpr_should_log(severity) == 0) {
return;
}
gpr_log_func_args lfargs;
memset(&lfargs, 0, sizeof(lfargs));