mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 18:11:33 +08:00
Relace remaining const char* with string_view_t in the API
This commit is contained in:
parent
506ab1c735
commit
8d758add63
@ -58,7 +58,7 @@ SPDLOG_INLINE void swap(logger &a, logger &b)
|
||||
a.swap(b);
|
||||
}
|
||||
|
||||
SPDLOG_INLINE void logger::log(source_loc loc, level::level_enum lvl, const char *msg)
|
||||
SPDLOG_INLINE void logger::log(source_loc loc, level::level_enum lvl, string_view_t msg)
|
||||
{
|
||||
if (!should_log(lvl))
|
||||
{
|
||||
@ -67,7 +67,7 @@ SPDLOG_INLINE void logger::log(source_loc loc, level::level_enum lvl, const char
|
||||
|
||||
try
|
||||
{
|
||||
details::log_msg log_msg(loc, string_view_t(name_), lvl, string_view_t(msg));
|
||||
details::log_msg log_msg(loc, string_view_t(name_), lvl, msg);
|
||||
sink_it_(log_msg);
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
@ -80,7 +80,7 @@ SPDLOG_INLINE void logger::log(source_loc loc, level::level_enum lvl, const char
|
||||
}
|
||||
}
|
||||
|
||||
SPDLOG_INLINE void logger::log(level::level_enum lvl, const char *msg)
|
||||
SPDLOG_INLINE void logger::log(level::level_enum lvl, string_view_t msg)
|
||||
{
|
||||
log(source_loc{}, lvl, msg);
|
||||
}
|
||||
|
@ -97,8 +97,8 @@ public:
|
||||
log(source_loc{}, lvl, fmt, args...);
|
||||
}
|
||||
|
||||
void log(source_loc loc, level::level_enum lvl, const char *msg);
|
||||
void log(level::level_enum lvl, const char *msg);
|
||||
void log(source_loc loc, level::level_enum lvl, const string_view_t msg);
|
||||
void log(level::level_enum lvl, string_view_t msg);
|
||||
|
||||
template<typename... Args>
|
||||
void trace(string_view_t fmt, const Args &... args)
|
||||
|
Loading…
Reference in New Issue
Block a user