Support for source file/line logging

This commit is contained in:
gabime
2018-11-22 18:47:50 +02:00
parent 216cd6935f
commit f2305fe5bf
6 changed files with 176 additions and 32 deletions

View File

@@ -46,8 +46,13 @@ public:
template<typename... Args>
void log(level::level_enum lvl, const char *fmt, const Args &... args);
template<typename... Args>
void log(source_loc loc, level::level_enum lvl, const char *fmt, const Args &... args);
void log(level::level_enum lvl, const char *msg);
void log(source_loc loc, level::level_enum lvl, const char *msg);
template<typename... Args>
void trace(const char *fmt, const Args &... args);
@@ -73,6 +78,9 @@ public:
template<typename... Args>
void log(level::level_enum lvl, const wchar_t *fmt, const Args &... args);
template<typename... Args>
void log(source_location soruce, level::level_enum lvl, const wchar_t *fmt, const Args &... args);
template<typename... Args>
void trace(const wchar_t *fmt, const Args &... args);
@@ -97,10 +105,18 @@ public:
template<class T, typename std::enable_if<std::is_convertible<T, spdlog::string_view_t>::value, T>::type * = nullptr>
void log(level::level_enum lvl, const T &);
// T can be statically converted to string_view
template<class T, typename std::enable_if<std::is_convertible<T, spdlog::string_view_t>::value, T>::type * = nullptr>
void log(source_loc loc, level::level_enum lvl, const T &);
// T cannot be statically converted to string_view
template<class T, typename std::enable_if<!std::is_convertible<T, spdlog::string_view_t>::value, T>::type * = nullptr>
void log(level::level_enum lvl, const T &);
// T cannot be statically converted to string_view
template<class T, typename std::enable_if<!std::is_convertible<T, spdlog::string_view_t>::value, T>::type * = nullptr>
void log(source_loc loc, level::level_enum lvl, const T &);
template<typename T>
void trace(const T &msg);