diff options
Diffstat (limited to 'source/DataFormatters/FormatManager.cpp')
-rw-r--r-- | source/DataFormatters/FormatManager.cpp | 58 |
1 files changed, 21 insertions, 37 deletions
diff --git a/source/DataFormatters/FormatManager.cpp b/source/DataFormatters/FormatManager.cpp index 6e5fdf92305f..7619b6f6f82b 100644 --- a/source/DataFormatters/FormatManager.cpp +++ b/source/DataFormatters/FormatManager.cpp @@ -17,11 +17,11 @@ // Project includes #include "lldb/Core/Debugger.h" -#include "lldb/Core/Log.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/DataFormatters/LanguageCategory.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Language.h" +#include "lldb/Utility/Log.h" using namespace lldb; using namespace lldb_private; @@ -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; } |