Move under exception handler
Static analysis still sometimes flags that this throws, even through
clang-tidy doesn't. Move it under the exception handler.
Tested: Logging still works.
Change-Id: I67425749b97b0a259746840c7b9a9b4834dfe52e
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/http/logging.hpp b/http/logging.hpp
index 4b9eab9..768014a 100644
--- a/http/logging.hpp
+++ b/http/logging.hpp
@@ -79,13 +79,14 @@
std::string_view filename = loc.file_name();
filename = filename.substr(filename.rfind('/') + 1);
std::string logLocation;
- logLocation = std::format("[{} {}:{}] ", levelString, filename, loc.line());
try
{
// TODO, multiple static analysis tools flag that this could potentially
// throw Based on the documentation, it shouldn't throw, so long as none
// of the formatters throw, so unclear at this point why this try/catch
// is required, but add it to silence the static analysis tools.
+ logLocation = std::format("[{} {}:{}] ", levelString, filename,
+ loc.line());
logLocation += std::format(std::move(format),
std::forward<Args>(args)...);
}