Skip to content
Snippets Groups Projects
Commit 72a175a3 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'issue/fmt-lib-runtime-parsing' into 'master'

fmtlib needs to wrap the format string in fmt::runtime

See merge request amdis/amdis!132
parents 23c2996b 61cab9bd
No related branches found
No related tags found
No related merge requests found
......@@ -57,9 +57,9 @@ namespace AMDiS
OStream& msg_all(OStream& out, std::string const& str, Args&&... args)
{
if (Environment::mpiSize() > 1)
fmt::print(out, "[" + std::to_string(Environment::mpiRank()) + "] " + str, FWD(args)...);
fmt::print(out, fmt::runtime("[" + std::to_string(Environment::mpiRank()) + "] " + str), FWD(args)...);
else
fmt::print(out, str, FWD(args)...);
fmt::print(out, fmt::runtime(str), FWD(args)...);
return out;
}
......@@ -70,9 +70,9 @@ namespace AMDiS
return msg_all(out, str, FWD(args)...);
if (Environment::mpiSize() > 1 && Environment::mpiRank() == 0)
fmt::print(out, "[0] " + str, FWD(args)...);
fmt::print(out, fmt::runtime("[0] " + str), FWD(args)...);
else if (Environment::mpiSize() == 1)
fmt::print(out, str, FWD(args)...);
fmt::print(out, fmt::runtime(str), FWD(args)...);
return out;
}
......@@ -82,6 +82,12 @@ namespace AMDiS
std::cout << __PRETTY_FUNCTION__ << std::endl;
}
template <class T>
void printType ()
{
std::cout << __PRETTY_FUNCTION__ << std::endl;
}
} // end namespace Impl
......@@ -143,7 +149,7 @@ namespace AMDiS
Impl::msg_all(std::cerr, "ERROR: " + str + "\n", FWD(args)...);
std::abort();
#else
throw std::runtime_error( std::string("ERROR: ") + fmt::format(str, FWD(args)...));
throw std::runtime_error( std::string("ERROR: ") + fmt::format(fmt::runtime(str), FWD(args)...));
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment