Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package spdlog for openSUSE:Factory checked in at 2021-07-28 19:19:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/spdlog (Old) and /work/SRC/openSUSE:Factory/.spdlog.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "spdlog" Wed Jul 28 19:19:35 2021 rev:20 rq:908612 version:1.9.1 Changes: -------- --- /work/SRC/openSUSE:Factory/spdlog/spdlog.changes 2021-07-22 22:43:19.383202728 +0200 +++ /work/SRC/openSUSE:Factory/.spdlog.new.1899/spdlog.changes 2021-07-28 19:19:58.359640823 +0200 @@ -1,0 +2,9 @@ +Tue Jul 27 13:31:38 UTC 2021 - Luigi Baldoni <aloi...@gmx.com> + +- Update to version 1.9.1 + * Support for {fmt}'s compile time validation of format strings. + * In C++14/17 - format string can be validated at compile time + using FMT_STRING. + * Fixed compilation error in Clang 13 with C++20. + +------------------------------------------------------------------- Old: ---- spdlog-1.9.0.tar.gz New: ---- spdlog-1.9.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ spdlog.spec ++++++ --- /var/tmp/diff_new_pack.VNGJET/_old 2021-07-28 19:19:59.531639286 +0200 +++ /var/tmp/diff_new_pack.VNGJET/_new 2021-07-28 19:19:59.535639281 +0200 @@ -18,7 +18,7 @@ %define _sover 1 Name: spdlog -Version: 1.9.0 +Version: 1.9.1 Release: 0 Summary: C++ logging library License: MIT ++++++ spdlog-1.9.0.tar.gz -> spdlog-1.9.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spdlog-1.9.0/.travis.yml new/spdlog-1.9.1/.travis.yml --- old/spdlog-1.9.0/.travis.yml 2021-07-20 22:01:34.000000000 +0200 +++ new/spdlog-1.9.1/.travis.yml 2021-07-27 11:26:34.000000000 +0200 @@ -50,6 +50,16 @@ sources: - sourceline: "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key" + +addons: &clang12 + apt: + packages: + - clang-12 + - lldb-12 + - lld-12 + sources: + - sourceline: "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main" + key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key" matrix: @@ -89,8 +99,14 @@ os: linux dist: bionic addons: *clang10 + - + # Test clang-12.0: C++17, Build=Debug + - env: CLANG_VERSION=12 BUILD_TYPE=Debug CPP=17 ASAN=Off + os: linux + dist: bionic + addons: *clang12 + before_script: - if [ -n "$GCC_VERSION" ]; then export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}"; fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spdlog-1.9.0/example/example.cpp new/spdlog-1.9.1/example/example.cpp --- old/spdlog-1.9.0/example/example.cpp 2021-07-20 22:01:34.000000000 +0200 +++ new/spdlog-1.9.1/example/example.cpp 2021-07-27 11:26:34.000000000 +0200 @@ -22,7 +22,8 @@ void custom_flags_example(); #include "spdlog/spdlog.h" -#include "spdlog/cfg/env.h" // support for loading levels from the environment variable +#include "spdlog/cfg/env.h" // support for loading levels from the environment variable +#include "spdlog/fmt/ostr.h" // support for user defined types int main(int, char *[]) { @@ -221,7 +222,6 @@ } // User defined types logging by implementing operator<< -#include "spdlog/fmt/ostr.h" // must be included struct my_type { int i; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spdlog-1.9.0/include/spdlog/common.h new/spdlog-1.9.1/include/spdlog/common.h --- old/spdlog-1.9.0/include/spdlog/common.h 2021-07-20 22:01:34.000000000 +0200 +++ new/spdlog-1.9.1/include/spdlog/common.h 2021-07-27 11:26:34.000000000 +0200 @@ -123,13 +123,24 @@ template<typename T> struct is_convertible_to_wstring_view : std::is_convertible<T, wstring_view_t> {}; +template<class T> +struct is_convertible_to_wformat_string : std::is_convertible<T, fmt::wformat_string<>> +{}; # endif // _WIN32 #else template<typename> struct is_convertible_to_wstring_view : std::false_type {}; +template<class> +struct is_convertible_to_wformat_string : std::false_type +{}; #endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT +template<class T> +struct is_convertible_to_basic_format_string + : std::integral_constant<bool, std::is_convertible<const T &, fmt::format_string<>>::value || is_convertible_to_wformat_string<T>::value> +{}; + #if defined(SPDLOG_NO_ATOMIC_LEVELS) using level_t = details::null_atomic_int; #else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spdlog-1.9.0/include/spdlog/details/fmt_helper.h new/spdlog-1.9.1/include/spdlog/details/fmt_helper.h --- old/spdlog-1.9.0/include/spdlog/details/fmt_helper.h 2021-07-20 22:01:34.000000000 +0200 +++ new/spdlog-1.9.1/include/spdlog/details/fmt_helper.h 2021-07-27 11:26:34.000000000 +0200 @@ -55,7 +55,7 @@ } else // unlikely, but just in case, let fmt deal with it { - fmt::format_to(std::back_inserter(dest), "{:02}", n); + fmt::format_to(std::back_inserter(dest), SPDLOG_FMT_RUNTIME("{:02}"), n); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spdlog-1.9.0/include/spdlog/fmt/bin_to_hex.h new/spdlog-1.9.1/include/spdlog/fmt/bin_to_hex.h --- old/spdlog-1.9.0/include/spdlog/fmt/bin_to_hex.h 2021-07-20 22:01:34.000000000 +0200 +++ new/spdlog-1.9.1/include/spdlog/fmt/bin_to_hex.h 2021-07-27 11:26:34.000000000 +0200 @@ -89,7 +89,7 @@ // parse the format string flags template<typename ParseContext> - auto parse(ParseContext &ctx) -> decltype(ctx.begin()) + FMT_CONSTEXPR auto parse(ParseContext &ctx) -> decltype(ctx.begin()) { auto it = ctx.begin(); while (it != ctx.end() && *it != '}') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spdlog-1.9.0/include/spdlog/logger.h new/spdlog-1.9.1/include/spdlog/logger.h --- old/spdlog-1.9.0/include/spdlog/logger.h 2021-07-20 22:01:34.000000000 +0200 +++ new/spdlog-1.9.1/include/spdlog/logger.h 2021-07-27 11:26:34.000000000 +0200 @@ -77,14 +77,14 @@ logger &operator=(logger other) SPDLOG_NOEXCEPT; void swap(spdlog::logger &other) SPDLOG_NOEXCEPT; - template<typename FormatString, typename... Args> - void log(source_loc loc, level::level_enum lvl, const FormatString &fmt, Args &&...args) + template<typename... Args> + void log(source_loc loc, level::level_enum lvl, fmt::format_string<Args...> fmt, Args &&...args) { log_(loc, lvl, fmt, std::forward<Args>(args)...); } - template<typename FormatString, typename... Args> - void log(level::level_enum lvl, const FormatString &fmt, Args &&...args) + template<typename... Args> + void log(level::level_enum lvl, fmt::format_string<Args...> fmt, Args &&...args) { log(source_loc{}, lvl, fmt, std::forward<Args>(args)...); } @@ -102,6 +102,15 @@ log(loc, lvl, string_view_t{msg}); } + // T cannot be statically converted to neither string_view, nor wstring_view and nor format string + template<class T, typename std::enable_if<!std::is_convertible<const T &, spdlog::string_view_t>::value && + !is_convertible_to_basic_format_string<const T &>::value, + int>::type = 0> + void log(source_loc loc, level::level_enum lvl, const T &msg) + { + log(loc, lvl, "{}", msg); + } + void log(log_clock::time_point log_time, source_loc loc, level::level_enum lvl, string_view_t msg) { bool log_enabled = should_log(lvl); @@ -133,50 +142,91 @@ 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, - int>::type = 0> - void log(source_loc loc, level::level_enum lvl, const T &msg) + template<typename... Args> + void trace(fmt::format_string<Args...> fmt, Args &&...args) { - log(loc, lvl, "{}", msg); + log(level::trace, fmt, std::forward<Args>(args)...); + } + + template<typename... Args> + void debug(fmt::format_string<Args...> fmt, Args &&...args) + { + log(level::debug, fmt, std::forward<Args>(args)...); + } + + template<typename... Args> + void info(fmt::format_string<Args...> fmt, Args &&...args) + { + log(level::info, fmt, std::forward<Args>(args)...); + } + + template<typename... Args> + void warn(fmt::format_string<Args...> fmt, Args &&...args) + { + log(level::warn, fmt, std::forward<Args>(args)...); + } + + template<typename... Args> + void error(fmt::format_string<Args...> fmt, Args &&...args) + { + log(level::err, fmt, std::forward<Args>(args)...); } - template<typename FormatString, typename... Args> - void trace(const FormatString &fmt, Args &&...args) + template<typename... Args> + void critical(fmt::format_string<Args...> fmt, Args &&...args) + { + log(level::critical, fmt, std::forward<Args>(args)...); + } + +#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT + template<typename... Args> + void log(level::level_enum lvl, fmt::wformat_string<Args...> fmt, Args &&...args) + { + log(source_loc{}, lvl, fmt, std::forward<Args>(args)...); + } + + template<typename... Args> + void log(source_loc loc, level::level_enum lvl, fmt::wformat_string<Args...> fmt, Args &&...args) + { + log_(loc, lvl, fmt, std::forward<Args>(args)...); + } + + template<typename... Args> + void trace(fmt::wformat_string<Args...> fmt, Args &&...args) { log(level::trace, fmt, std::forward<Args>(args)...); } - template<typename FormatString, typename... Args> - void debug(const FormatString &fmt, Args &&...args) + template<typename... Args> + void debug(fmt::wformat_string<Args...> fmt, Args &&...args) { log(level::debug, fmt, std::forward<Args>(args)...); } - template<typename FormatString, typename... Args> - void info(const FormatString &fmt, Args &&...args) + template<typename... Args> + void info(fmt::wformat_string<Args...> fmt, Args &&...args) { log(level::info, fmt, std::forward<Args>(args)...); } - template<typename FormatString, typename... Args> - void warn(const FormatString &fmt, Args &&...args) + template<typename... Args> + void warn(fmt::wformat_string<Args...> fmt, Args &&...args) { log(level::warn, fmt, std::forward<Args>(args)...); } - template<typename FormatString, typename... Args> - void error(const FormatString &fmt, Args &&...args) + template<typename... Args> + void error(fmt::wformat_string<Args...> fmt, Args &&...args) { log(level::err, fmt, std::forward<Args>(args)...); } - template<typename FormatString, typename... Args> - void critical(const FormatString &fmt, Args &&...args) + template<typename... Args> + void critical(fmt::wformat_string<Args...> fmt, Args &&...args) { log(level::critical, fmt, std::forward<Args>(args)...); } +#endif template<typename T> void trace(const T &msg) @@ -269,9 +319,8 @@ details::backtracer tracer_; // common implementation for after templated public api has been resolved - template<typename FormatString, typename... Args, typename Char = fmt::char_t<FormatString>, - typename std::enable_if<!std::is_same<Char, wchar_t>::value, Char>::type * = nullptr> - void log_(source_loc loc, level::level_enum lvl, const FormatString &fmt, Args &&...args) + template<typename... Args> + void log_(source_loc loc, level::level_enum lvl, string_view_t fmt, Args &&...args) { bool log_enabled = should_log(lvl); bool traceback_enabled = tracer_.enabled(); @@ -282,7 +331,7 @@ SPDLOG_TRY { memory_buf_t buf; - fmt::detail::vformat_to(buf, fmt::to_string_view(fmt), fmt::make_format_args(args...)); + fmt::detail::vformat_to(buf, fmt, fmt::make_format_args(args...)); details::log_msg log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size())); log_it_(log_msg, log_enabled, traceback_enabled); } @@ -291,7 +340,7 @@ #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT template<typename... Args> - void log_(source_loc loc, level::level_enum lvl, const wstring_view_t &fmt, Args &&...args) + void log_(source_loc loc, level::level_enum lvl, wstring_view_t fmt, Args &&...args) { bool log_enabled = should_log(lvl); bool traceback_enabled = tracer_.enabled(); @@ -303,7 +352,7 @@ { // format to wmemory_buffer and convert to utf8 fmt::wmemory_buffer wbuf; - fmt::format_to(std::back_inserter(wbuf), fmt, std::forward<Args>(args)...); + fmt::detail::vformat_to(wbuf, fmt, fmt::make_format_args<fmt::wformat_context>(args...)); memory_buf_t buf; details::os::wstr_to_utf8buf(wstring_view_t(wbuf.data(), wbuf.size()), buf); details::log_msg log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size())); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spdlog-1.9.0/include/spdlog/spdlog.h new/spdlog-1.9.1/include/spdlog/spdlog.h --- old/spdlog-1.9.0/include/spdlog/spdlog.h 2021-07-20 22:01:34.000000000 +0200 +++ new/spdlog-1.9.1/include/spdlog/spdlog.h 2021-07-27 11:26:34.000000000 +0200 @@ -127,50 +127,50 @@ SPDLOG_API void set_default_logger(std::shared_ptr<spdlog::logger> default_logger); -template<typename FormatString, typename... Args> -inline void log(source_loc source, level::level_enum lvl, const FormatString &fmt, Args &&...args) +template<typename... Args> +inline void log(source_loc source, level::level_enum lvl, fmt::format_string<Args...> fmt, Args &&...args) { default_logger_raw()->log(source, lvl, fmt, std::forward<Args>(args)...); } -template<typename FormatString, typename... Args> -inline void log(level::level_enum lvl, const FormatString &fmt, Args &&...args) +template<typename... Args> +inline void log(level::level_enum lvl, fmt::format_string<Args...> fmt, Args &&...args) { default_logger_raw()->log(source_loc{}, lvl, fmt, std::forward<Args>(args)...); } -template<typename FormatString, typename... Args> -inline void trace(const FormatString &fmt, Args &&...args) +template<typename... Args> +inline void trace(fmt::format_string<Args...> fmt, Args &&...args) { default_logger_raw()->trace(fmt, std::forward<Args>(args)...); } -template<typename FormatString, typename... Args> -inline void debug(const FormatString &fmt, Args &&...args) +template<typename... Args> +inline void debug(fmt::format_string<Args...> fmt, Args &&...args) { default_logger_raw()->debug(fmt, std::forward<Args>(args)...); } -template<typename FormatString, typename... Args> -inline void info(const FormatString &fmt, Args &&...args) +template<typename... Args> +inline void info(fmt::format_string<Args...> fmt, Args &&...args) { default_logger_raw()->info(fmt, std::forward<Args>(args)...); } -template<typename FormatString, typename... Args> -inline void warn(const FormatString &fmt, Args &&...args) +template<typename... Args> +inline void warn(fmt::format_string<Args...> fmt, Args &&...args) { default_logger_raw()->warn(fmt, std::forward<Args>(args)...); } -template<typename FormatString, typename... Args> -inline void error(const FormatString &fmt, Args &&...args) +template<typename... Args> +inline void error(fmt::format_string<Args...> fmt, Args &&...args) { default_logger_raw()->error(fmt, std::forward<Args>(args)...); } -template<typename FormatString, typename... Args> -inline void critical(const FormatString &fmt, Args &&...args) +template<typename... Args> +inline void critical(fmt::format_string<Args...> fmt, Args &&...args) { default_logger_raw()->critical(fmt, std::forward<Args>(args)...); } @@ -187,6 +187,56 @@ default_logger_raw()->log(lvl, msg); } +#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT +template<typename... Args> +inline void log(source_loc source, level::level_enum lvl, fmt::wformat_string<Args...> fmt, Args &&...args) +{ + default_logger_raw()->log(source, lvl, fmt, std::forward<Args>(args)...); +} + +template<typename... Args> +inline void log(level::level_enum lvl, fmt::wformat_string<Args...> fmt, Args &&...args) +{ + default_logger_raw()->log(source_loc{}, lvl, fmt, std::forward<Args>(args)...); +} + +template<typename... Args> +inline void trace(fmt::wformat_string<Args...> fmt, Args &&...args) +{ + default_logger_raw()->trace(fmt, std::forward<Args>(args)...); +} + +template<typename... Args> +inline void debug(fmt::wformat_string<Args...> fmt, Args &&...args) +{ + default_logger_raw()->debug(fmt, std::forward<Args>(args)...); +} + +template<typename... Args> +inline void info(fmt::wformat_string<Args...> fmt, Args &&...args) +{ + default_logger_raw()->info(fmt, std::forward<Args>(args)...); +} + +template<typename... Args> +inline void warn(fmt::wformat_string<Args...> fmt, Args &&...args) +{ + default_logger_raw()->warn(fmt, std::forward<Args>(args)...); +} + +template<typename... Args> +inline void error(fmt::wformat_string<Args...> fmt, Args &&...args) +{ + default_logger_raw()->error(fmt, std::forward<Args>(args)...); +} + +template<typename... Args> +inline void critical(fmt::wformat_string<Args...> fmt, Args &&...args) +{ + default_logger_raw()->critical(fmt, std::forward<Args>(args)...); +} +#endif + template<typename T> inline void trace(const T &msg) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spdlog-1.9.0/tests/test_errors.cpp new/spdlog-1.9.1/tests/test_errors.cpp --- old/spdlog-1.9.0/tests/test_errors.cpp 2021-07-20 22:01:34.000000000 +0200 +++ new/spdlog-1.9.1/tests/test_errors.cpp 2021-07-27 11:26:34.000000000 +0200 @@ -29,7 +29,7 @@ auto logger = spdlog::create<spdlog::sinks::basic_file_sink_mt>("test-error", filename, true); logger->set_pattern("%v"); - logger->info("Test message {} {}", 1); + logger->info(fmt::runtime("Test message {} {}"), 1); logger->info("Test message {}", 2); logger->flush(); @@ -49,7 +49,7 @@ logger->set_error_handler([=](const std::string &) { throw custom_ex(); }); logger->info("Good message #1"); - REQUIRE_THROWS_AS(logger->info("Bad format msg {} {}", "xxx"), custom_ex); + REQUIRE_THROWS_AS(logger->info(fmt::runtime("Bad format msg {} {}"), "xxx"), custom_ex); logger->info("Good message #2"); require_message_count(SIMPLE_LOG, 2); } @@ -88,7 +88,7 @@ ofs << err_msg; }); logger->info("Good message #1"); - logger->info("Bad format msg {} {}", "xxx"); + logger->info(fmt::runtime("Bad format msg {} {}"), "xxx"); logger->info("Good message #2"); spdlog::drop("logger"); // force logger to drain the queue and shutdown } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spdlog-1.9.0/tests/test_stdout_api.cpp new/spdlog-1.9.1/tests/test_stdout_api.cpp --- old/spdlog-1.9.0/tests/test_stdout_api.cpp 2021-07-20 22:01:34.000000000 +0200 +++ new/spdlog-1.9.1/tests/test_stdout_api.cpp 2021-07-27 11:26:34.000000000 +0200 @@ -95,4 +95,4 @@ spdlog::drop_all(); } -#endif \ No newline at end of file +#endif