diff --git a/AUTHORS b/AUTHORS index 5ec8b46310..b3cbb4db35 100644 --- a/AUTHORS +++ b/AUTHORS @@ -111,6 +111,7 @@ Saul Kravitz Sergio Garcia Murillo Shaofan Qi Shuhai Peng +Seija Silviu Caragea Stefan Gula Stephan Hartmann diff --git a/rtc_base/logging.cc b/rtc_base/logging.cc index 4bc9183d97..65d50594b6 100644 --- a/rtc_base/logging.cc +++ b/rtc_base/logging.cc @@ -363,20 +363,16 @@ void LogMessage::OutputToDebug(const LogLineRef& log_line) { // On the Mac, all stderr output goes to the Console log and causes clutter. // So in opt builds, don't log to stderr unless the user specifically sets // a preference to do so. - CFStringRef key = CFStringCreateWithCString( - kCFAllocatorDefault, "logToStdErr", kCFStringEncodingUTF8); CFStringRef domain = CFBundleGetIdentifier(CFBundleGetMainBundle()); - if (key != nullptr && domain != nullptr) { + if (domain != nullptr) { Boolean exists_and_is_valid; Boolean should_log = - CFPreferencesGetAppBooleanValue(key, domain, &exists_and_is_valid); + CFPreferencesGetAppBooleanValue(CFSTR("logToStdErr"), domain, + &exists_and_is_valid); // If the key doesn't exist or is invalid or is false, we will not log to // stderr. log_to_stderr = exists_and_is_valid && should_log; } - if (key != nullptr) { - CFRelease(key); - } #endif // defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) && defined(NDEBUG) #if defined(WEBRTC_WIN)