Simplify logging statements.
BUG=NONE
R=henrika@webrtc.org
Review URL: https://codereview.webrtc.org/2115603004 .
Cr-Commit-Position: refs/heads/master@{#13375}
diff --git a/webrtc/modules/audio_device/android/audio_device_template.h b/webrtc/modules/audio_device/android/audio_device_template.h
index 46d97f6..31b1cf7 100644
--- a/webrtc/modules/audio_device/android/audio_device_template.h
+++ b/webrtc/modules/audio_device/android/audio_device_template.h
@@ -497,11 +497,7 @@
}
int32_t EnableBuiltInAEC(bool enable) override {
- if (enable) {
- LOG(INFO) << __FUNCTION__ << ": enabling built in AEC";
- } else {
- LOG(INFO) << __FUNCTION__ << ": disabling built in AEC";
- }
+ LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK(BuiltInAECIsAvailable()) << "HW AEC is not available";
return input_.EnableBuiltInAEC(enable);
}
@@ -514,11 +510,7 @@
}
int32_t EnableBuiltInAGC(bool enable) override {
- if (enable) {
- LOG(INFO) << __FUNCTION__ << ": enabling built in AGC";
- } else {
- LOG(INFO) << __FUNCTION__ << ": disabling built in AGC";
- }
+ LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK(BuiltInAGCIsAvailable()) << "HW AGC is not available";
return input_.EnableBuiltInAGC(enable);
}
@@ -531,11 +523,7 @@
}
int32_t EnableBuiltInNS(bool enable) override {
- if (enable) {
- LOG(INFO) << __FUNCTION__ << ": enabling built in NS";
- } else {
- LOG(INFO) << __FUNCTION__ << ": disabling built in NS";
- }
+ LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK(BuiltInNSIsAvailable()) << "HW NS is not available";
return input_.EnableBuiltInNS(enable);
}
diff --git a/webrtc/modules/audio_device/audio_device_impl.cc b/webrtc/modules/audio_device/audio_device_impl.cc
index 7c8840a..4fd461c 100644
--- a/webrtc/modules/audio_device/audio_device_impl.cc
+++ b/webrtc/modules/audio_device/audio_device_impl.cc
@@ -560,12 +560,7 @@
}
*available = isAvailable;
-
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return (0);
}
@@ -594,8 +589,7 @@
}
*volume = level;
-
- LOG(INFO) << __FUNCTION__ << " output: " << *volume;
+ LOG(INFO) << "output: " << *volume;
return (0);
}
@@ -628,9 +622,7 @@
*volumeLeft = volLeft;
*volumeRight = volRight;
-
- LOG(INFO) << __FUNCTION__ << " output: volumeLeft = " << *volumeLeft
- << ", volumeRight = " << *volumeRight;
+ LOG(INFO) << "output: " << *volumeLeft << ", " << *volumeRight;
return (0);
}
@@ -644,12 +636,7 @@
CHECK_INITIALIZED_BOOL();
bool isInitialized = _ptrAudioDevice->SpeakerIsInitialized();
-
- if (isInitialized) {
- LOG(INFO) << __FUNCTION__ << " output: initialized";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not initialized";
- }
+ LOG(INFO) << "output: " << isInitialized;
return (isInitialized);
}
@@ -662,12 +649,7 @@
CHECK_INITIALIZED_BOOL();
bool isInitialized = _ptrAudioDevice->MicrophoneIsInitialized();
-
- if (isInitialized) {
- LOG(INFO) << __FUNCTION__ << " output: initialized";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not initialized";
- }
+ LOG(INFO) << "output: " << isInitialized;
return (isInitialized);
}
@@ -686,8 +668,7 @@
}
*maxVolume = maxVol;
-
- LOG(INFO) << __FUNCTION__ << " output: maxVolume = " << *maxVolume;
+ LOG(INFO) << "output: " << *maxVolume;
return (0);
}
@@ -706,8 +687,7 @@
}
*minVolume = minVol;
-
- LOG(INFO) << __FUNCTION__ << " output: " << *minVolume;
+ LOG(INFO) << "output: " << *minVolume;
return (0);
}
@@ -727,8 +707,7 @@
}
*stepSize = delta;
-
- LOG(INFO) << __FUNCTION__ << " output: " << *stepSize;
+ LOG(INFO) << "output: " << *stepSize;
return (0);
}
@@ -747,12 +726,7 @@
}
*available = isAvailable;
-
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return (0);
}
@@ -781,12 +755,7 @@
}
*enabled = muted;
-
- if (muted) {
- LOG(INFO) << __FUNCTION__ << " output: muted";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not muted";
- }
+ LOG(INFO) << "output: " << muted;
return (0);
}
@@ -805,12 +774,7 @@
}
*available = isAvailable;
-
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return (0);
}
@@ -839,12 +803,7 @@
}
*enabled = muted;
-
- if (muted) {
- LOG(INFO) << __FUNCTION__ << " output: muted";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not muted";
- }
+ LOG(INFO) << "output: " << muted;
return (0);
}
@@ -863,12 +822,7 @@
}
*available = isAvailable;
-
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return (0);
}
@@ -897,12 +851,7 @@
}
*enabled = onOff;
-
- if (onOff) {
- LOG(INFO) << __FUNCTION__ << " output: enabled";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not enabled";
- }
+ LOG(INFO) << "output: " << onOff;
return (0);
}
@@ -921,12 +870,7 @@
}
*available = isAvailable;
-
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return (0);
}
@@ -955,8 +899,7 @@
}
*volume = level;
-
- LOG(INFO) << __FUNCTION__ << " output: volume = " << *volume;
+ LOG(INFO) << "output: " << *volume;
return (0);
}
@@ -976,12 +919,7 @@
}
*available = isAvailable;
-
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return (0);
}
@@ -999,11 +937,7 @@
}
if (_ptrAudioDevice->SetStereoRecording(enable) == -1) {
- if (enable) {
- LOG(WARNING) << "failed to enable stereo recording";
- } else {
- LOG(WARNING) << "failed to disable stereo recording";
- }
+ LOG(WARNING) << "failed to change stereo recording";
return -1;
}
@@ -1031,12 +965,7 @@
}
*enabled = stereo;
-
- if (stereo) {
- LOG(INFO) << __FUNCTION__ << " output: enabled";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not enabled";
- }
+ LOG(INFO) << "output: " << stereo;
return (0);
}
@@ -1079,15 +1008,13 @@
}
*channel = chType;
-
if (*channel == kChannelBoth) {
- LOG(INFO) << __FUNCTION__ << " output: both";
+ LOG(INFO) << "output: both";
} else if (*channel == kChannelLeft) {
- LOG(INFO) << __FUNCTION__ << " output: left";
+ LOG(INFO) << "output: left";
} else {
- LOG(INFO) << __FUNCTION__ << " output: right";
+ LOG(INFO) << "output: right";
}
-
return (0);
}
@@ -1106,12 +1033,7 @@
}
*available = isAvailable;
-
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return (0);
}
@@ -1158,12 +1080,7 @@
}
*enabled = stereo;
-
- if (stereo) {
- LOG(INFO) << __FUNCTION__ << " output: enabled";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not enabled";
- }
+ LOG(INFO) << "output: " << stereo;
return (0);
}
@@ -1202,12 +1119,7 @@
}
*available = isAvailable;
-
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return (0);
}
@@ -1226,12 +1138,7 @@
}
*available = isAvailable;
-
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return (0);
}
@@ -1250,8 +1157,7 @@
}
*maxVolume = maxVol;
-
- LOG(INFO) << __FUNCTION__ << " output: = " << *maxVolume;
+ LOG(INFO) << "output: " << *maxVolume;
return (0);
}
@@ -1270,8 +1176,7 @@
}
*minVolume = minVol;
-
- LOG(INFO) << __FUNCTION__ << " output: = " << *minVolume;
+ LOG(INFO) << "output: " << *minVolume;
return (0);
}
@@ -1291,8 +1196,7 @@
}
*stepSize = delta;
-
- LOG(INFO) << __FUNCTION__ << " output: " << *stepSize;
+ LOG(INFO) << "output: " << *stepSize;
return (0);
}
@@ -1305,8 +1209,7 @@
CHECK_INITIALIZED();
uint16_t nPlayoutDevices = _ptrAudioDevice->PlayoutDevices();
-
- LOG(INFO) << __FUNCTION__ << " output: " << nPlayoutDevices;
+ LOG(INFO) << "output: " << nPlayoutDevices;
return ((int16_t)(nPlayoutDevices));
}
@@ -1325,9 +1228,6 @@
// ----------------------------------------------------------------------------
int32_t AudioDeviceModuleImpl::SetPlayoutDevice(WindowsDeviceType device) {
- if (device == kDefaultDevice) {
- } else {
- }
LOG(INFO) << __FUNCTION__;
CHECK_INITIALIZED();
@@ -1355,10 +1255,10 @@
}
if (name != NULL) {
- LOG(INFO) << __FUNCTION__ << " output: name = " << name;
+ LOG(INFO) << "output: name = " << name;
}
if (guid != NULL) {
- LOG(INFO) << __FUNCTION__ << " output: guid = " << guid;
+ LOG(INFO) << "output: guid = " << guid;
}
return (0);
@@ -1385,10 +1285,10 @@
}
if (name != NULL) {
- LOG(INFO) << __FUNCTION__ << " output: name = " << name;
+ LOG(INFO) << "output: name = " << name;
}
if (guid != NULL) {
- LOG(INFO) << __FUNCTION__ << " output: guid = " << guid;
+ LOG(INFO) << "output: guid = " << guid;
}
return (0);
@@ -1404,7 +1304,7 @@
uint16_t nRecordingDevices = _ptrAudioDevice->RecordingDevices();
- LOG(INFO) << __FUNCTION__ << " output: " << nRecordingDevices;
+ LOG(INFO) << "output: " << nRecordingDevices;
return ((int16_t)nRecordingDevices);
}
@@ -1423,9 +1323,6 @@
// ----------------------------------------------------------------------------
int32_t AudioDeviceModuleImpl::SetRecordingDevice(WindowsDeviceType device) {
- if (device == kDefaultDevice) {
- } else {
- }
LOG(INFO) << __FUNCTION__;
CHECK_INITIALIZED();
@@ -1644,17 +1541,11 @@
int32_t AudioDeviceModuleImpl::SetPlayoutBuffer(const BufferType type,
uint16_t sizeMS) {
if (type == kFixedBufferSize) {
- LOG(INFO) << __FUNCTION__ << "("
- << "fixed buffer, " << sizeMS << "ms"
- << ")";
+ LOG(INFO) << __FUNCTION__ << "(fixed buffer, " << sizeMS << "ms)";
} else if (type == kAdaptiveBufferSize) {
- LOG(INFO) << __FUNCTION__ << "("
- << "adaptive buffer, " << sizeMS << "ms"
- << ")";
+ LOG(INFO) << __FUNCTION__ << "(adaptive buffer, " << sizeMS << "ms)";
} else {
- LOG(INFO) << __FUNCTION__ << "("
- << "?, " << sizeMS << "ms"
- << ")";
+ LOG(INFO) << __FUNCTION__ << "(?, " << sizeMS << "ms)";
}
CHECK_INITIALIZED();
@@ -1702,8 +1593,7 @@
*type = bufType;
*sizeMS = size;
- LOG(INFO) << __FUNCTION__ << " output: type = " << *type
- << ", sizeMS = " << *sizeMS;
+ LOG(INFO) << "output: type = " << *type << ", sizeMS = " << *sizeMS;
return (0);
}
@@ -1723,8 +1613,7 @@
}
*delayMS = delay;
-
- LOG(LS_VERBOSE) << __FUNCTION__ << " output: delayMS = " << *delayMS;
+ LOG(LS_VERBOSE) << "output: " << *delayMS;
return (0);
}
@@ -1744,8 +1633,7 @@
}
*delayMS = delay;
-
- LOG(INFO) << __FUNCTION__ << " output: delayMS = " << *delayMS;
+ LOG(INFO) << "output: " << *delayMS;
return (0);
}
@@ -1765,8 +1653,7 @@
}
*load = cpuLoad;
-
- LOG(INFO) << __FUNCTION__ << " output: load = " << *load;
+ LOG(INFO) << "output: " << *load;
return (0);
}
@@ -1803,8 +1690,7 @@
}
*samplesPerSec = sampleRate;
-
- LOG(INFO) << __FUNCTION__ << " output: samplesPerSec = " << *samplesPerSec;
+ LOG(INFO) << "output: " << *samplesPerSec;
return (0);
}
@@ -1841,8 +1727,7 @@
}
*samplesPerSec = sampleRate;
-
- LOG(INFO) << __FUNCTION__ << " output: samplesPerSec = " << *samplesPerSec;
+ LOG(INFO) << "output: " << *samplesPerSec;
return (0);
}
@@ -1887,7 +1772,7 @@
if (_ptrAudioDevice->GetLoudspeakerStatus(*enabled) != 0) {
ok = -1;
}
- LOG(INFO) << __FUNCTION__ << " output: " << ok;
+ LOG(INFO) << "output: " << ok;
return ok;
}
@@ -1895,11 +1780,7 @@
LOG(INFO) << __FUNCTION__;
CHECK_INITIALIZED_BOOL();
bool isEnabled = _ptrAudioDevice->BuiltInAECIsEnabled();
- if (isEnabled) {
- LOG(INFO) << __FUNCTION__ << " output: enabled";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not enabled";
- }
+ LOG(INFO) << "output: " << isEnabled;
return isEnabled;
}
@@ -1907,11 +1788,7 @@
LOG(INFO) << __FUNCTION__;
CHECK_INITIALIZED_BOOL();
bool isAvailable = _ptrAudioDevice->BuiltInAECIsAvailable();
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return isAvailable;
}
@@ -1919,7 +1796,7 @@
LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECK_INITIALIZED();
int32_t ok = _ptrAudioDevice->EnableBuiltInAEC(enable);
- LOG(INFO) << __FUNCTION__ << " output: " << ok;
+ LOG(INFO) << "output: " << ok;
return ok;
}
@@ -1927,11 +1804,7 @@
LOG(INFO) << __FUNCTION__;
CHECK_INITIALIZED_BOOL();
bool isAvailable = _ptrAudioDevice->BuiltInAGCIsAvailable();
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return isAvailable;
}
@@ -1939,7 +1812,7 @@
LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECK_INITIALIZED();
int32_t ok = _ptrAudioDevice->EnableBuiltInAGC(enable);
- LOG(INFO) << __FUNCTION__ << " output: " << ok;
+ LOG(INFO) << "output: " << ok;
return ok;
}
@@ -1947,11 +1820,7 @@
LOG(INFO) << __FUNCTION__;
CHECK_INITIALIZED_BOOL();
bool isAvailable = _ptrAudioDevice->BuiltInNSIsAvailable();
- if (isAvailable) {
- LOG(INFO) << __FUNCTION__ << " output: available";
- } else {
- LOG(INFO) << __FUNCTION__ << " output: not available";
- }
+ LOG(INFO) << "output: " << isAvailable;
return isAvailable;
}
@@ -1959,7 +1828,7 @@
LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECK_INITIALIZED();
int32_t ok = _ptrAudioDevice->EnableBuiltInNS(enable);
- LOG(INFO) << __FUNCTION__ << " output: " << ok;
+ LOG(INFO) << "output: " << ok;
return ok;
}
@@ -1967,7 +1836,7 @@
AudioParameters* params) const {
LOG(INFO) << __FUNCTION__;
int r = _ptrAudioDevice->GetPlayoutAudioParameters(params);
- LOG(INFO) << __FUNCTION__ << " output: " << r;
+ LOG(INFO) << "output: " << r;
return r;
}
@@ -1975,7 +1844,7 @@
AudioParameters* params) const {
LOG(INFO) << __FUNCTION__;
int r = _ptrAudioDevice->GetRecordAudioParameters(params);
- LOG(INFO) << __FUNCTION__ << " output: " << r;
+ LOG(INFO) << "output: " << r;
return r;
}