Remove unused and rarely used LOG_ macros.

BUG=

Review URL: https://codereview.webrtc.org/1522053002

Cr-Commit-Position: refs/heads/master@{#11014}
This commit is contained in:
solenberg 2015-12-14 08:22:11 -08:00 committed by Commit bot
parent e22e1cb399
commit 82ccfcf5ca
4 changed files with 11 additions and 56 deletions

View File

@ -44,20 +44,16 @@ int ACMResampler::Resample10Msec(const int16_t* in_audio,
if (resampler_.InitializeIfNeeded(in_freq_hz, out_freq_hz,
num_audio_channels) != 0) {
LOG_FERR3(LS_ERROR, InitializeIfNeeded, in_freq_hz, out_freq_hz,
num_audio_channels);
LOG(LS_ERROR) << "InitializeIfNeeded(" << in_freq_hz << ", " << out_freq_hz
<< ", " << num_audio_channels << ") failed.";
return -1;
}
out_length =
resampler_.Resample(in_audio, in_length, out_audio, out_capacity_samples);
if (out_length == -1) {
LOG_FERR4(LS_ERROR,
Resample,
in_audio,
in_length,
out_audio,
out_capacity_samples);
LOG(LS_ERROR) << "Resample(" << in_audio << ", " << in_length << ", "
<< out_audio << ", " << out_capacity_samples << ") failed.";
return -1;
}

View File

@ -168,19 +168,19 @@ int AgcManagerDirect::Initialize() {
// example, what happens when we change devices.
if (gctrl_->set_mode(GainControl::kFixedDigital) != 0) {
LOG_FERR1(LS_ERROR, set_mode, GainControl::kFixedDigital);
LOG(LS_ERROR) << "set_mode(GainControl::kFixedDigital) failed.";
return -1;
}
if (gctrl_->set_target_level_dbfs(2) != 0) {
LOG_FERR1(LS_ERROR, set_target_level_dbfs, 2);
LOG(LS_ERROR) << "set_target_level_dbfs(2) failed.";
return -1;
}
if (gctrl_->set_compression_gain_db(kDefaultCompressionGain) != 0) {
LOG_FERR1(LS_ERROR, set_compression_gain_db, kDefaultCompressionGain);
LOG(LS_ERROR) << "set_compression_gain_db(kDefaultCompressionGain) failed.";
return -1;
}
if (gctrl_->enable_limiter(true) != 0) {
LOG_FERR1(LS_ERROR, enable_limiter, true);
LOG(LS_ERROR) << "enable_limiter(true) failed.";
return -1;
}
return 0;
@ -244,7 +244,7 @@ void AgcManagerDirect::Process(const int16_t* audio,
}
if (agc_->Process(audio, length, sample_rate_hz) != 0) {
LOG_FERR0(LS_ERROR, Agc::Process);
LOG(LS_ERROR) << "Agc::Process failed";
assert(false);
}
@ -434,7 +434,8 @@ void AgcManagerDirect::UpdateCompressor() {
compression_ = new_compression;
compression_accumulator_ = new_compression;
if (gctrl_->set_compression_gain_db(compression_) != 0) {
LOG_FERR1(LS_ERROR, set_compression_gain_db, compression_);
LOG(LS_ERROR) << "set_compression_gain_db(" << compression_
<< ") failed.";
}
}
}

View File

@ -36,18 +36,6 @@
// type (basically, it just doesn't prepend the namespace).
// LOG_F(sev) Like LOG(), but includes the name of the current function.
// Additional helper macros added by WebRTC:
// LOG_API is a shortcut for API call logging. Pass in the input parameters of
// the method. For example:
// Foo(int bar, int baz) {
// LOG_API2(bar, baz);
// }
//
// LOG_FERR is a shortcut for logging a failed function call. For example:
// if (!Foo(bar)) {
// LOG_FERR1(LS_WARNING, Foo, bar);
// }
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_LOGGING_H_
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_LOGGING_H_
@ -137,23 +125,6 @@ class LogMessageVoidify {
#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": "
#endif
#define LOG_API0() LOG_F(LS_VERBOSE)
#define LOG_API1(v1) LOG_API0() << #v1 << "=" << v1
#define LOG_API2(v1, v2) LOG_API1(v1) \
<< ", " << #v2 << "=" << v2
#define LOG_API3(v1, v2, v3) LOG_API2(v1, v2) \
<< ", " << #v3 << "=" << v3
#define LOG_FERR0(sev, func) LOG(sev) << #func << " failed"
#define LOG_FERR1(sev, func, v1) LOG_FERR0(sev, func) \
<< ": " << #v1 << "=" << v1
#define LOG_FERR2(sev, func, v1, v2) LOG_FERR1(sev, func, v1) \
<< ", " << #v2 << "=" << v2
#define LOG_FERR3(sev, func, v1, v2, v3) LOG_FERR2(sev, func, v1, v2) \
<< ", " << #v3 << "=" << v3
#define LOG_FERR4(sev, func, v1, v2, v3, v4) LOG_FERR3(sev, func, v1, v2, v3) \
<< ", " << #v4 << "=" << v4
#endif // LOG
} // namespace webrtc

View File

@ -72,18 +72,5 @@ TEST_F(LoggingTest, LogStream) {
}
}
TEST_F(LoggingTest, LogFunctionError) {
{
CriticalSectionScoped cs(crit_.get());
int bar = 42;
int baz = 99;
level_ = kTraceError;
expected_log_ << "(logging_unittest.cc:" << __LINE__ + 2
<< "): Foo failed: bar=" << bar << ", baz=" << baz;
LOG_FERR2(LS_ERROR, Foo, bar, baz);
cv_->SleepCS(*crit_.get(), 2000);
}
}
} // namespace
} // namespace webrtc