aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarnManager.cpp
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2022-05-31 03:14:42 +0200
committerGravatar GitHub <noreply@github.com> 2022-05-31 01:14:42 +0000
commitd2eea5d7ca00065416ca480fcfc6aec1625f811e (patch)
tree4b995c55f70c83b2d84eacdf9efbcd09a3ef929c /Source/Utils/WarnManager.cpp
parentd5f61eafc3de4f15a02edcbb3a7b95abdc774ab7 (diff)
downloadWarpX-d2eea5d7ca00065416ca480fcfc6aec1625f811e.tar.gz
WarpX-d2eea5d7ca00065416ca480fcfc6aec1625f811e.tar.zst
WarpX-d2eea5d7ca00065416ca480fcfc6aec1625f811e.zip
Move MsgLogger to ablastr (#3148)
* move Msg Logger to ablastr * fixed bug * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed bug Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'Source/Utils/WarnManager.cpp')
-rw-r--r--Source/Utils/WarnManager.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/Source/Utils/WarnManager.cpp b/Source/Utils/WarnManager.cpp
index 1fc93a03b..18f065ab7 100644
--- a/Source/Utils/WarnManager.cpp
+++ b/Source/Utils/WarnManager.cpp
@@ -7,10 +7,10 @@
#include "WarnManager.H"
-#include "MsgLogger/MsgLogger.H"
#include "WarpXUtil.H"
#include <ablastr/utils/TextMsg.H>
+#include <ablastr/utils/msg_logger/MsgLogger.H>
#include <AMReX_ParallelDescriptor.H>
@@ -18,19 +18,20 @@
#include <sstream>
using namespace Utils;
-using namespace Utils::MsgLogger;
+
+namespace abl_msg_logger = ablastr::utils::msg_logger;
WarnManager::WarnManager():
m_rank{amrex::ParallelDescriptor::MyProc()},
- m_p_logger{std::make_unique<Logger>()}
+ m_p_logger{std::make_unique<abl_msg_logger::Logger>()}
{}
void WarnManager::record_warning(
std::string topic,
std::string text,
- Priority priority)
+ abl_msg_logger::Priority priority)
{
- m_p_logger->record_msg(Msg{topic, text, priority});
+ m_p_logger->record_msg(abl_msg_logger::Msg{topic, text, priority});
}
std::string WarnManager::print_local_warnings(const std::string& when) const
@@ -105,7 +106,8 @@ void WarnManager::debug_read_warnings_from_input(amrex::ParmParse& params)
std::string spriority;
pp_warn.query("priority", spriority);
- Priority priority = StringToPriority(spriority);
+ abl_msg_logger::Priority priority =
+ abl_msg_logger::StringToPriority(spriority);
int all_involved = 0;
pp_warn.query("all_involved", all_involved);
@@ -125,15 +127,15 @@ void WarnManager::debug_read_warnings_from_input(amrex::ParmParse& params)
}
std::string WarnManager::print_warn_msg(
- const MsgLogger::MsgWithCounter& msg_with_counter) const
+ const abl_msg_logger::MsgWithCounter& msg_with_counter) const
{
std::stringstream ss;
ss << "* --> ";
- if (msg_with_counter.msg.priority == MsgLogger::Priority::high)
+ if (msg_with_counter.msg.priority == abl_msg_logger::Priority::high)
ss << "[!!!]";
- else if (msg_with_counter.msg.priority == MsgLogger::Priority::medium)
+ else if (msg_with_counter.msg.priority == abl_msg_logger::Priority::medium)
ss << "[!! ]";
- else if (msg_with_counter.msg.priority == MsgLogger::Priority::low)
+ else if (msg_with_counter.msg.priority == abl_msg_logger::Priority::low)
ss << "[! ]";
else
ss << "[???]";
@@ -153,7 +155,7 @@ std::string WarnManager::print_warn_msg(
}
std::string WarnManager::print_warn_msg(
- const MsgLogger::MsgWithCounterAndRanks& msg_with_counter_and_ranks) const
+ const abl_msg_logger::MsgWithCounterAndRanks& msg_with_counter_and_ranks) const
{
std::stringstream ss;
ss << this->print_warn_msg(msg_with_counter_and_ranks.msg_with_counter);