mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 02:21:34 +08:00
additional log overload
calling log with a string_view as msg called ``` template<typename... Args> void log(source_loc loc, level::level_enum lvl, string_view_t fmt, const Args &... args) ``` instead of ``` 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) ``` which lead to an unnecessary call to fmt::format
This commit is contained in:
parent
f3d99f41d4
commit
25b10dc264
@ -143,6 +143,11 @@ public:
|
||||
// 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)
|
||||
{
|
||||
log(loc,lvl, string_view_t{msg});
|
||||
}
|
||||
|
||||
void log(source_loc loc, level::level_enum lvl, string_view_t msg)
|
||||
{
|
||||
bool log_enabled = should_log(lvl);
|
||||
bool traceback_enabled = tracer_.enabled();
|
||||
|
Loading…
Reference in New Issue
Block a user