From d1712bf8cb64b5f30322fb9b636288489db4bcec Mon Sep 17 00:00:00 2001 From: William JCM Date: Fri, 25 Nov 2022 09:43:11 +0100 Subject: [PATCH] Mass: add logging indentation to refreshValues(). --- src/Mass/Mass.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Mass/Mass.cpp b/src/Mass/Mass.cpp index 3a79b6b..2608948 100644 --- a/src/Mass/Mass.cpp +++ b/src/Mass/Mass.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include "PropertyNames.h" @@ -78,6 +79,16 @@ auto Mass::getNameFromFile(Containers::StringView path) -> Containers::Optional< void Mass::refreshValues() { LOG_INFO_FORMAT("Refreshing values for {}.", _filename); + logger().lockMutex(); + logger().indent(); + logger().unlockMutex(); + + Containers::ScopeGuard indent_guard{[]{ + logger().lockMutex(); + logger().unindent(); + logger().unlockMutex(); + }}; + LOG_INFO("Checking if file exists."); if(!Utility::Path::exists(Utility::Path::join(_folder, _filename))) { LOG_WARNING_FORMAT("{} doesn't exist in {}.", _filename, _folder);