aboutsummaryrefslogtreecommitdiff
path: root/src/common/Configuration/Config.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-01-08 21:16:53 +0100
committerShauren <shauren.trinity@gmail.com>2023-01-08 21:16:53 +0100
commitd791afae1dfcfaf592326f787755ca32d629e4d3 (patch)
tree54dc9916ede5800e110a2f0edff91530811fbdb8 /src/common/Configuration/Config.cpp
parentb6820a706f46f18b9652fcd9806e4bec8805d29d (diff)
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
Diffstat (limited to 'src/common/Configuration/Config.cpp')
-rw-r--r--src/common/Configuration/Config.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/common/Configuration/Config.cpp b/src/common/Configuration/Config.cpp
index 9a02627d2b7..93f7d367730 100644
--- a/src/common/Configuration/Config.cpp
+++ b/src/common/Configuration/Config.cpp
@@ -226,25 +226,25 @@ T ConfigMgr::GetValueDefault(std::string const& name, T def, bool quiet) const
Optional<T> castedVar = Trinity::StringTo<T>(*envVar);
if (!castedVar)
{
- TC_LOG_ERROR("server.loading", "Bad value defined for name %s in environment variables, going to use default instead", name.c_str());
+ TC_LOG_ERROR("server.loading", "Bad value defined for name {} in environment variables, going to use default instead", name);
return def;
}
if (!quiet)
- TC_LOG_WARN("server.loading", "Missing name %s in config file %s, recovered with environment '%s' value.", name.c_str(), _filename.c_str(), envVar->c_str());
+ TC_LOG_WARN("server.loading", "Missing name {} in config file {}, recovered with environment '{}' value.", name, _filename, *envVar);
return *castedVar;
}
else if (!quiet)
{
- TC_LOG_WARN("server.loading", "Missing name %s in config file %s, add \"%s = %s\" to this file",
- name.c_str(), _filename.c_str(), name.c_str(), std::to_string(def).c_str());
+ TC_LOG_WARN("server.loading", "Missing name {} in config file {}, add \"{} = {}\" to this file",
+ name, _filename, name, def);
}
}
catch (bpt::ptree_bad_data const&)
{
- TC_LOG_ERROR("server.loading", "Bad value defined for name %s in config file %s, going to use %s instead",
- name.c_str(), _filename.c_str(), std::to_string(def).c_str());
+ TC_LOG_ERROR("server.loading", "Bad value defined for name {} in config file {}, going to use {} instead",
+ name, _filename, def);
}
return def;
@@ -263,20 +263,20 @@ std::string ConfigMgr::GetValueDefault<std::string>(std::string const& name, std
if (envVar)
{
if (!quiet)
- TC_LOG_WARN("server.loading", "Missing name %s in config file %s, recovered with environment '%s' value.", name.c_str(), _filename.c_str(), envVar->c_str());
+ TC_LOG_WARN("server.loading", "Missing name {} in config file {}, recovered with environment '{}' value.", name, _filename, *envVar);
return *envVar;
}
else if (!quiet)
{
- TC_LOG_WARN("server.loading", "Missing name %s in config file %s, add \"%s = %s\" to this file",
- name.c_str(), _filename.c_str(), name.c_str(), def.c_str());
+ TC_LOG_WARN("server.loading", "Missing name {} in config file {}, add \"{} = {}\" to this file",
+ name, _filename, name, def);
}
}
catch (bpt::ptree_bad_data const&)
{
- TC_LOG_ERROR("server.loading", "Bad value defined for name %s in config file %s, going to use %s instead",
- name.c_str(), _filename.c_str(), def.c_str());
+ TC_LOG_ERROR("server.loading", "Bad value defined for name {} in config file {}, going to use {} instead",
+ name, _filename, def);
}
return def;
@@ -298,8 +298,8 @@ bool ConfigMgr::GetBoolDefault(std::string const& name, bool def, bool quiet) co
return *boolVal;
else
{
- TC_LOG_ERROR("server.loading", "Bad value defined for name %s in config file %s, going to use '%s' instead",
- name.c_str(), _filename.c_str(), def ? "true" : "false");
+ TC_LOG_ERROR("server.loading", "Bad value defined for name {} in config file {}, going to use '{}' instead",
+ name, _filename, def ? "true" : "false");
return def;
}
}