mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-13 01:10:26 +08:00
Removed check if format string can be converted to fmt::is_compile_string
This commit is contained in:
parent
70d2832c0d
commit
e87f69bdb6
@ -75,20 +75,12 @@ public:
|
|||||||
|
|
||||||
void swap(spdlog::logger &other) SPDLOG_NOEXCEPT;
|
void swap(spdlog::logger &other) SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
// FormatString is a type derived from fmt::compile_string
|
template<typename FormatString, typename... Args>
|
||||||
template<typename FormatString, typename std::enable_if<fmt::is_compile_string<FormatString>::value, int>::type = 0, typename... Args>
|
|
||||||
void log(source_loc loc, level::level_enum lvl, const FormatString &fmt, Args &&...args)
|
void log(source_loc loc, level::level_enum lvl, const FormatString &fmt, Args &&...args)
|
||||||
{
|
{
|
||||||
log_(loc, lvl, fmt, std::forward<Args>(args)...);
|
log_(loc, lvl, fmt, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FormatString is NOT a type derived from fmt::compile_string but is a string_view_t or can be implicitly converted to one
|
|
||||||
template<typename... Args>
|
|
||||||
void log(source_loc loc, level::level_enum lvl, string_view_t fmt, Args &&...args)
|
|
||||||
{
|
|
||||||
log_(loc, lvl, fmt, std::forward<Args>(args)...);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename FormatString, typename... Args>
|
template<typename FormatString, typename... Args>
|
||||||
void log(level::level_enum lvl, const FormatString &fmt, Args &&...args)
|
void log(level::level_enum lvl, const FormatString &fmt, Args &&...args)
|
||||||
{
|
{
|
||||||
@ -137,9 +129,8 @@ public:
|
|||||||
log(source_loc{}, lvl, msg);
|
log(source_loc{}, lvl, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// T can be statically converted to string_view and isn't a fmt::compile_string
|
// T can be statically converted to string_view
|
||||||
template<class T, typename std::enable_if<
|
template<class T, typename std::enable_if<std::is_convertible<const T &, spdlog::string_view_t>::value, int>::type = 0>
|
||||||
std::is_convertible<const T &, spdlog::string_view_t>::value && !fmt::is_compile_string<T>::value, int>::type = 0>
|
|
||||||
void log(source_loc loc, level::level_enum lvl, const T &msg)
|
void log(source_loc loc, level::level_enum lvl, const T &msg)
|
||||||
{
|
{
|
||||||
log(loc, lvl, string_view_t{msg});
|
log(loc, lvl, string_view_t{msg});
|
||||||
|
Loading…
Reference in New Issue
Block a user