Remove WEBRTC_TRACE from webrtc/modules/audio_coding

We'd like to remove all occurrences of WEBRTC_TRACE and delete the
macro! One logging mechanism is enough.


NOTRY=True

Bug: webrtc:5118
Change-Id: Ic226318e0aebe3a71785fcb4ce07371872ab7128
Reviewed-on: https://chromium-review.googlesource.com/518133
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18712}
diff --git a/webrtc/modules/audio_coding/acm2/codec_manager.cc b/webrtc/modules/audio_coding/acm2/codec_manager.cc
index 734358a..e218080 100644
--- a/webrtc/modules/audio_coding/acm2/codec_manager.cc
+++ b/webrtc/modules/audio_coding/acm2/codec_manager.cc
@@ -11,9 +11,9 @@
 #include "webrtc/modules/audio_coding/acm2/codec_manager.h"
 
 #include "webrtc/base/checks.h"
-#include "webrtc/base/format_macros.h"
+//#include "webrtc/base/format_macros.h"
+#include "webrtc/base/logging.h"
 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h"
-#include "webrtc/system_wrappers/include/trace.h"
 #include "webrtc/typedefs.h"
 
 namespace webrtc {
@@ -23,34 +23,29 @@
 
 // Check if the given codec is a valid to be registered as send codec.
 int IsValidSendCodec(const CodecInst& send_codec) {
-  int dummy_id = 0;
   if ((send_codec.channels != 1) && (send_codec.channels != 2)) {
-    WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, dummy_id,
-                 "Wrong number of channels (%" PRIuS ", only mono and stereo "
-                 "are supported)",
-                 send_codec.channels);
+    LOG(LS_ERROR) << "Wrong number of channels (" << send_codec.channels
+                  << "), only mono and stereo are supported)";
     return -1;
   }
 
   auto maybe_codec_id = RentACodec::CodecIdByInst(send_codec);
   if (!maybe_codec_id) {
-    WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, dummy_id,
-                 "Invalid codec setting for the send codec.");
+    LOG(LS_ERROR) << "Invalid codec setting for the send codec.";
     return -1;
   }
 
   // Telephone-event cannot be a send codec.
   if (!STR_CASE_CMP(send_codec.plname, "telephone-event")) {
-    WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, dummy_id,
-                 "telephone-event cannot be a send codec");
+    LOG(LS_ERROR) << "telephone-event cannot be a send codec";
     return -1;
   }
 
   if (!RentACodec::IsSupportedNumChannels(*maybe_codec_id, send_codec.channels)
            .value_or(false)) {
-    WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, dummy_id,
-                 "%" PRIuS " number of channels not supportedn for %s.",
-                 send_codec.channels, send_codec.plname);
+    LOG(LS_ERROR) << send_codec.channels
+                  << " number of channels not supported for "
+                  << send_codec.plname << ".";
     return -1;
   }
   return RentACodec::CodecIndexFromId(*maybe_codec_id).value_or(-1);
@@ -81,15 +76,13 @@
     return false;
   }
 
-  int dummy_id = 0;
   switch (RentACodec::RegisterRedPayloadType(
       &codec_stack_params_.red_payload_types, send_codec)) {
     case RentACodec::RegistrationResult::kOk:
       return true;
     case RentACodec::RegistrationResult::kBadFreq:
-      WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, dummy_id,
-                   "RegisterSendCodec() failed, invalid frequency for RED"
-                   " registration");
+      LOG(LS_ERROR) << "RegisterSendCodec() failed, invalid frequency for RED"
+                       " registration";
       return false;
     case RentACodec::RegistrationResult::kSkip:
       break;
@@ -99,9 +92,8 @@
     case RentACodec::RegistrationResult::kOk:
       return true;
     case RentACodec::RegistrationResult::kBadFreq:
-      WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, dummy_id,
-                   "RegisterSendCodec() failed, invalid frequency for CNG"
-                   " registration");
+      LOG(LS_ERROR) << "RegisterSendCodec() failed, invalid frequency for CNG"
+                       " registration";
       return false;
     case RentACodec::RegistrationResult::kSkip:
       break;
@@ -135,15 +127,14 @@
 
 bool CodecManager::SetCopyRed(bool enable) {
   if (enable && codec_stack_params_.use_codec_fec) {
-    WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceAudioCoding, 0,
-                 "Codec internal FEC and RED cannot be co-enabled.");
+    LOG(LS_WARNING) << "Codec internal FEC and RED cannot be co-enabled.";
     return false;
   }
   if (enable && send_codec_inst_ &&
       codec_stack_params_.red_payload_types.count(send_codec_inst_->plfreq) <
           1) {
-    WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceAudioCoding, 0,
-                 "Cannot enable RED at %i Hz.", send_codec_inst_->plfreq);
+    LOG(LS_WARNING) << "Cannot enable RED at " << send_codec_inst_->plfreq
+                    << " Hz.";
     return false;
   }
   codec_stack_params_.use_red = enable;
@@ -162,8 +153,7 @@
           ? (codec_stack_params_.speech_encoder->NumChannels() != 1)
           : false;
   if (enable && stereo_send) {
-    WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, 0,
-                 "VAD/DTX not supported for stereo sending");
+    LOG(LS_ERROR) << "VAD/DTX not supported for stereo sending";
     return false;
   }
 
@@ -181,8 +171,7 @@
 
 bool CodecManager::SetCodecFEC(bool enable_codec_fec) {
   if (enable_codec_fec && codec_stack_params_.use_red) {
-    WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceAudioCoding, 0,
-                 "Codec internal FEC and RED cannot be co-enabled.");
+    LOG(LS_WARNING) << "Codec internal FEC and RED cannot be co-enabled.";
     return false;
   }