From d898c019c4e09c73bc7354da9f1b54004f3e4b7e Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Wed, 14 Nov 2012 19:07:54 +0000 Subject: Add libjingle-style stream-style logging. Add a highly stripped-down version of libjingle's base/logging.h. It is a thin wrapper around WEBRTC_TRACE, maintaining the libjingle log semantics to ease a transition to that format. Also add some helper macros for easy API and function failure logging. Review URL: https://webrtc-codereview.appspot.com/931010 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@3099 4adac7df-926f-26a2-2b94-8c16560cd09d --- voice_engine/voe_audio_processing_impl.cc | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'voice_engine/voe_audio_processing_impl.cc') diff --git a/voice_engine/voe_audio_processing_impl.cc b/voice_engine/voe_audio_processing_impl.cc index 62440f4e..9397bfaf 100644 --- a/voice_engine/voe_audio_processing_impl.cc +++ b/voice_engine/voe_audio_processing_impl.cc @@ -13,18 +13,13 @@ #include "audio_processing.h" #include "channel.h" #include "critical_section_wrapper.h" +#include "logging.h" #include "trace.h" #include "transmit_mixer.h" #include "voe_errors.h" #include "voice_engine_impl.h" // TODO(andrew): move to a common place. -#define WEBRTC_TRACE_VOICE_API() \ - do { \ - WEBRTC_TRACE(kTraceApiCall, kTraceVoice, \ - VoEId(_shared->instance_id(), -1), __FUNCTION__); \ - } while (0) - #define WEBRTC_VOICE_INIT_CHECK() \ do { \ if (!_shared->statistics().Initialized()) { \ @@ -41,7 +36,6 @@ } \ } while (0) - namespace webrtc { #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) @@ -353,9 +347,7 @@ int VoEAudioProcessingImpl::GetAgcConfig(AgcConfig& config) { int VoEAudioProcessingImpl::SetRxNsStatus(int channel, bool enable, NsModes mode) { - WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), - "SetRxNsStatus(channel=%d, enable=%d, mode=%d)", - channel, (int)enable, (int)mode); + LOG_API3(channel, enable, mode); #ifdef WEBRTC_VOICE_ENGINE_NR if (!_shared->statistics().Initialized()) { _shared->SetLastError(VE_NOT_INITED, kTraceError); @@ -514,7 +506,7 @@ bool VoEAudioProcessing::DriftCompensationSupported() { } int VoEAudioProcessingImpl::EnableDriftCompensation(bool enable) { - WEBRTC_TRACE_VOICE_API(); + LOG_API1(enable); WEBRTC_VOICE_INIT_CHECK(); if (!DriftCompensationSupported()) { @@ -533,7 +525,7 @@ int VoEAudioProcessingImpl::EnableDriftCompensation(bool enable) { } bool VoEAudioProcessingImpl::DriftCompensationEnabled() { - WEBRTC_TRACE_VOICE_API(); + LOG_API0(); WEBRTC_VOICE_INIT_CHECK_BOOL(); EchoCancellation* aec = _shared->audio_processing()->echo_cancellation(); @@ -1139,13 +1131,12 @@ int VoEAudioProcessingImpl::SetTypingDetectionParameters(int timeWindow, } void VoEAudioProcessingImpl::EnableStereoChannelSwapping(bool enable) { - WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), - "EnableStereoChannelSwapping(enable=%d)", enable); + LOG_API1(enable); _shared->transmit_mixer()->EnableStereoChannelSwapping(enable); } bool VoEAudioProcessingImpl::IsStereoChannelSwappingEnabled() { - WEBRTC_TRACE_VOICE_API(); + LOG_API0(); return _shared->transmit_mixer()->IsStereoChannelSwappingEnabled(); } -- cgit v1.2.3