Added a forceable level to non source loc required methods

This commit is contained in:
WolverinDEV 2019-11-23 18:30:21 +01:00
parent 2e29c2a284
commit 7227fa78ee
1 changed files with 23 additions and 0 deletions

View File

@ -104,6 +104,12 @@ public:
log(source_loc{}, lvl, fmt, args...);
}
template<typename... Args>
void log(level::forceable lvl, string_view_t fmt, const Args &... args)
{
log(source_loc{}, lvl, fmt, args...);
}
template<typename... Args>
void trace(string_view_t fmt, const Args &... args)
{
@ -146,6 +152,12 @@ public:
log(source_loc{}, lvl, msg);
}
template<typename T>
void log(level::forceable lvl, const T &msg)
{
log(source_loc{}, lvl, msg);
}
// T can be statically converted to string_view
template<class T, typename std::enable_if<std::is_convertible<const T &, spdlog::string_view_t>::value, T>::type * = nullptr>
void log(source_loc loc, level::level_enum lvl, const T &msg) {
@ -176,6 +188,11 @@ public:
log(source_loc{}, lvl, msg);
}
void log(level::forceable lvl, string_view_t msg)
{
log(source_loc{}, lvl, msg);
}
// T cannot be statically converted to string_view or wstring_view
template<class T, typename std::enable_if<!std::is_convertible<const T &, spdlog::string_view_t>::value &&
!is_convertible_to_wstring_view<const T &>::value,
@ -268,6 +285,12 @@ public:
log(source_loc{}, lvl, fmt, args...);
}
template<typename... Args>
void log(level::forceable lvl, wstring_view_t fmt, const Args &... args)
{
log(source_loc{}, lvl, fmt, args...);
}
template<typename... Args>
void trace(wstring_view_t fmt, const Args &... args)
{