diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2025-07-28 20:56:05 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2025-08-01 14:35:04 -0400 |
| commit | 8df034ed6b3a1a52bd268ed43e783c35b687408f (patch) | |
| tree | caa89977dfffe302514489b96b6cda1765f0af2b /view | |
| parent | 1b2f5c4c8df34d399a8abaff7db5d2338cb90ac1 (diff) | |
Add LogForException APIs to pass stack trace information separate from the message
Diffstat (limited to 'view')
| -rw-r--r-- | view/elf/elfview.cpp | 6 | ||||
| -rw-r--r-- | view/macho/machoview.cpp | 4 | ||||
| -rw-r--r-- | view/md1rom/md1rom.cpp | 6 | ||||
| -rw-r--r-- | view/pe/peview.cpp | 6 | ||||
| -rw-r--r-- | view/pe/teview.cpp | 6 | ||||
| -rw-r--r-- | view/sharedcache/core/SharedCacheBuilder.cpp | 2 |
6 files changed, 19 insertions, 11 deletions
diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp index ae751269..5eb9cea7 100644 --- a/view/elf/elfview.cpp +++ b/view/elf/elfview.cpp @@ -2814,7 +2814,8 @@ Ref<BinaryView> ElfViewType::Create(BinaryView* data) } catch (std::exception& e) { - m_logger->LogError("%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); + m_logger->LogErrorForException( + e, "%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); return nullptr; } } @@ -2828,7 +2829,8 @@ Ref<BinaryView> ElfViewType::Parse(BinaryView* data) } catch (std::exception& e) { - m_logger->LogError("%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); + m_logger->LogErrorForException( + e, "%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); return nullptr; } } diff --git a/view/macho/machoview.cpp b/view/macho/machoview.cpp index 4e45b362..1da2bda7 100644 --- a/view/macho/machoview.cpp +++ b/view/macho/machoview.cpp @@ -3920,7 +3920,7 @@ Ref<BinaryView> MachoViewType::Create(BinaryView* data) } catch (std::exception& e) { - m_logger->LogErrorF("{}<BinaryViewType> failed to create view! {:?}", GetName(), e.what()); + m_logger->LogErrorForExceptionF(e, "{}<BinaryViewType> failed to create view! {:?}", GetName(), e.what()); return nullptr; } } @@ -3934,7 +3934,7 @@ Ref<BinaryView> MachoViewType::Parse(BinaryView* data) } catch (std::exception& e) { - m_logger->LogErrorF("{}<BinaryViewType> failed to create view! {:?}", GetName(), e.what()); + m_logger->LogErrorForExceptionF(e, "{}<BinaryViewType> failed to create view! {:?}", GetName(), e.what()); return nullptr; } } diff --git a/view/md1rom/md1rom.cpp b/view/md1rom/md1rom.cpp index b302cfb0..d0480cbe 100644 --- a/view/md1rom/md1rom.cpp +++ b/view/md1rom/md1rom.cpp @@ -380,7 +380,8 @@ Ref<BinaryView> Md1romViewType::Create(BinaryView* data) } catch (std::exception& e) { - m_logger->LogError("%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); + m_logger->LogErrorForException( + e, "%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); return nullptr; } } @@ -394,7 +395,8 @@ Ref<BinaryView> Md1romViewType::Parse(BinaryView* data) } catch (std::exception& e) { - m_logger->LogError("%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); + m_logger->LogErrorForException( + e, "%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); return nullptr; } } diff --git a/view/pe/peview.cpp b/view/pe/peview.cpp index c223d12b..1272c9af 100644 --- a/view/pe/peview.cpp +++ b/view/pe/peview.cpp @@ -3035,7 +3035,8 @@ Ref<BinaryView> PEViewType::Create(BinaryView* data) } catch (std::exception& e) { - m_logger->LogError("%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); + m_logger->LogErrorForException( + e, "%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); return nullptr; } } @@ -3049,7 +3050,8 @@ Ref<BinaryView> PEViewType::Parse(BinaryView* data) } catch (std::exception& e) { - m_logger->LogError("%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); + m_logger->LogErrorForException( + e, "%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); return nullptr; } } diff --git a/view/pe/teview.cpp b/view/pe/teview.cpp index 4c27c21a..5b0b75b9 100644 --- a/view/pe/teview.cpp +++ b/view/pe/teview.cpp @@ -333,7 +333,8 @@ Ref<BinaryView> TEViewType::Create(BinaryView* bv) } catch (std::exception& e) { - m_logger->LogError("%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); + m_logger->LogErrorForException( + e, "%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); return nullptr; } } @@ -346,7 +347,8 @@ Ref<BinaryView> TEViewType::Parse(BinaryView* bv) } catch (std::exception& e) { - m_logger->LogError("%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); + m_logger->LogErrorForException( + e, "%s<BinaryViewType> failed to create view! '%s'", GetName().c_str(), e.what()); return nullptr; } } diff --git a/view/sharedcache/core/SharedCacheBuilder.cpp b/view/sharedcache/core/SharedCacheBuilder.cpp index 11fadefd..5422d751 100644 --- a/view/sharedcache/core/SharedCacheBuilder.cpp +++ b/view/sharedcache/core/SharedCacheBuilder.cpp @@ -46,7 +46,7 @@ bool SharedCacheBuilder::AddFile( catch (const std::exception& e) { // Just return false so the view init can continue. - m_logger->LogErrorF("Failed to add file '{}': {}", fileName, e.what()); + m_logger->LogErrorForExceptionF(e, "Failed to add file '{}': {}", fileName, e.what()); return false; } |
