diff options
| author | Pavel Labath <labath@google.com> | 2017-02-13 11:03:17 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-02-13 11:03:17 +0000 |
| commit | 6302bf6a260ba5fbbd10214a3e23effc535fe6f5 (patch) | |
| tree | cacbbecff4255a03c32c14623018e8ad146f1f18 /lldb/source/DataFormatters | |
| parent | 796e0d6df1d6f8c20da4e8e2cb20c5c8939db6b3 (diff) | |
| download | bcm5719-llvm-6302bf6a260ba5fbbd10214a3e23effc535fe6f5.tar.gz bcm5719-llvm-6302bf6a260ba5fbbd10214a3e23effc535fe6f5.zip | |
Clean up debug logging
Summary:
We've had two ways to print a "debug" log message.
- Log::GetDebug() was testing a Stream flag which was never set.
- Log::Debug() was checking for the presence of "log enable --debug"
flag.
Given that these two were used very rarely and we already have a
different way to specify "I want a more verbose log", I propose to remove
these two functions and migrate the callers to LLDB_LOGV. This commit
does that.
Reviewers: clayborg, zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D29823
llvm-svn: 294939
Diffstat (limited to 'lldb/source/DataFormatters')
| -rw-r--r-- | lldb/source/DataFormatters/FormatManager.cpp | 56 |
1 files changed, 20 insertions, 36 deletions
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index 6e5fdf92305..a7006ccf830 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -660,11 +660,9 @@ FormatManager::GetFormat(ValueObject &valobj, if (log) { log->Printf( "[FormatManager::GetFormat] Cache search success. Returning."); - if (log->GetDebug()) - log->Printf("[FormatManager::GetFormat] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), - m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), + m_format_cache.GetCacheMisses()); } return retval; } @@ -705,10 +703,8 @@ FormatManager::GetFormat(ValueObject &valobj, match_data.GetTypeForCache().AsCString("<invalid>")); m_format_cache.SetFormat(match_data.GetTypeForCache(), retval); } - if (log && log->GetDebug()) - log->Printf("[FormatManager::GetFormat] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); return retval; } @@ -742,11 +738,9 @@ FormatManager::GetSummaryFormat(ValueObject &valobj, if (log) { log->Printf("[FormatManager::GetSummaryFormat] Cache search success. " "Returning."); - if (log->GetDebug()) - log->Printf("[FormatManager::GetSummaryFormat] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), - m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), + m_format_cache.GetCacheMisses()); } return retval; } @@ -787,10 +781,8 @@ FormatManager::GetSummaryFormat(ValueObject &valobj, match_data.GetTypeForCache().AsCString("<invalid>")); m_format_cache.SetSummary(match_data.GetTypeForCache(), retval); } - if (log && log->GetDebug()) - log->Printf("[FormatManager::GetSummaryFormat] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); return retval; } @@ -825,11 +817,9 @@ FormatManager::GetSyntheticChildren(ValueObject &valobj, if (log) { log->Printf("[FormatManager::GetSyntheticChildren] Cache search " "success. Returning."); - if (log->GetDebug()) - log->Printf( - "[FormatManager::GetSyntheticChildren] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), + m_format_cache.GetCacheMisses()); } return retval; } @@ -871,10 +861,8 @@ FormatManager::GetSyntheticChildren(ValueObject &valobj, match_data.GetTypeForCache().AsCString("<invalid>")); m_format_cache.SetSynthetic(match_data.GetTypeForCache(), retval); } - if (log && log->GetDebug()) - log->Printf("[FormatManager::GetSyntheticChildren] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); return retval; } #endif @@ -895,11 +883,9 @@ FormatManager::GetValidator(ValueObject &valobj, if (log) { log->Printf( "[FormatManager::GetValidator] Cache search success. Returning."); - if (log->GetDebug()) - log->Printf("[FormatManager::GetValidator] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), - m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), + m_format_cache.GetCacheMisses()); } return retval; } @@ -940,10 +926,8 @@ FormatManager::GetValidator(ValueObject &valobj, match_data.GetTypeForCache().AsCString("<invalid>")); m_format_cache.SetValidator(match_data.GetTypeForCache(), retval); } - if (log && log->GetDebug()) - log->Printf("[FormatManager::GetValidator] Cache hits: %" PRIu64 - " - Cache Misses: %" PRIu64, - m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); + LLDB_LOGV(log, "Cache hits: {0} - Cache Misses: {1}", + m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses()); return retval; } |

