remove optional logflag argument from Error::message() and Error::warning()

This commit is contained in:
Axel Kohlmeyer
2021-05-05 16:02:51 -04:00
parent ed45ef301f
commit 9f4da1128b
62 changed files with 71 additions and 70 deletions

View File

@ -118,6 +118,7 @@ void Error::universe_one(const std::string &file, int line, const std::string &s
void Error::universe_warn(const std::string &file, int line, const std::string &str)
{
if ((allwarn > maxwarn) || (maxwarn < 0)) return;
++numwarn;
if (universe->uscreen)
fmt::print(universe->uscreen,"WARNING on proc {}: {} ({}:{})\n",
@ -247,14 +248,14 @@ void Error::_one(const std::string &file, int line, fmt::string_view format,
only write to screen if non-nullptr on this proc since could be file
------------------------------------------------------------------------- */
void Error::warning(const std::string &file, int line, const std::string &str, int logflag)
void Error::warning(const std::string &file, int line, const std::string &str)
{
if ((allwarn > maxwarn) || (maxwarn < 0)) return;
++numwarn;
std::string mesg = fmt::format("WARNING: {} ({}:{})\n",
str,truncpath(file),line);
if (screen) fputs(mesg.c_str(),screen);
if (logflag && logfile) fputs(mesg.c_str(),logfile);
if (logfile) fputs(mesg.c_str(),logfile);
}
/* ----------------------------------------------------------------------
@ -262,12 +263,12 @@ void Error::warning(const std::string &file, int line, const std::string &str, i
write message to screen and logfile (if logflag is set)
------------------------------------------------------------------------- */
void Error::message(const std::string &file, int line, const std::string &str, int logflag)
void Error::message(const std::string &file, int line, const std::string &str)
{
std::string mesg = fmt::format("{} ({}:{})\n",str,truncpath(file),line);
if (screen) fputs(mesg.c_str(),screen);
if (logflag && logfile) fputs(mesg.c_str(),logfile);
if (logfile) fputs(mesg.c_str(),logfile);
}
/* ----------------------------------------------------------------------