SHA256
1
0
forked from pool/spdlog

Accepting request 1097821 from devel:libraries:c_c++

- Update to version 1.12.0
  * Support for external fmtlib versions 10.x (#2694). Thanks @H1X4Dev and @mguludag.
  * Better support for std::format (#2359, #2544, #2680, #2688). Thanks @eli-b , @sylveon and @bachittle.
  * Added new qt color sink. Logs to QTextEdit widget with some nice colors.
  * Update #include to a deprecated fmt header (#2545) .Thanks @kromain.
  * Fixes and impovements to dup_filter_sink (#2549, #2563). Thanks @zydxhs and @zhuyadong.
  * Fix unnecessary empty backtrace begin/end logs (#2568). Thanks @koldi.
  * Fixed variable name in msvc_sink (#2573). Thanks @naddu77.
  * Add system includes (SPDLOG_SYSTEM_INCLUDES) cmake option (#2575). Thanks @dpayne.
  * Improve dequeue of the async queue (@2587, #2588 ). Thanks @alokpr.
  * Fix tcp_client sink for FreeBSD (#2590). Thanks @segoon.
  * Support linux/musl libc (#2589). Thanks @kraj.
  * Support newlib C library configurations without tm_gmtoff field (#2600). Thanks @igrr.
  * Fix type of event id in win_eventlog_sink (#2598). Thanks @Tagl.
  * Fix -Wshadow warnings in spdlog::sinks::dist_sink (#2599). Thanks @robinlinden.
  * Spelling corrections (#2606, #2732). Thanks @albert-github and @zencatalyst.
  * Add sync() function to file_helper (#2343). Thanks @espkk.
  * Add a trivial callback_sink (#2610). Thanks @maghorbani.
  * Fix unexpected delimiter at start of line in to_hex formatter (#2627). Thanks @starsunyzl.
  * Fix MinGW build issue on example (#2642). Thanks @zEuS0390.
  * Add optional TID definition to the systemd sink (#2619). Thanks @chardin-cpi.
  * Added apply_logger_env_levels() (#2648, #2649). Thanks @afshinpir.
  * Support utf8 in msvc_sink (#2651). Thanks @Demonese.
  * Better handling of utf to wchar (66407f5).
  * Use catch v3 for tests (#2656, (#2659). Thanks @xvitaly and @seker.
  * New kafka sink (#2655). Thanks @vbirds and @SpriteOvO.
  * Fix os namespace in systemd_sink.h (#2668). Thanks @MyNameIsLame.
  * Enable systemd_sink tests in linux pipeline (#2669). Thanks @MyNameIsLame.
  * Fix stdout_sink_base::log's fflush() behaviour inconsistency (#2646). Thanks @25077667.
  * Fix for missing pthread_threadid_np in macOS < 10.6 and PowerPC (#2715). Thanks @barracuda156.
  * Fix ringbuffer_sink moving warning (#2722). Thanks @jamesruan.
  * Update INSTALL doc (#2775). Thanks @7starsea.
  * Fix warning in qt_sinks.h (#2781). Thanks @dayfixer.
  * Remove IPv4 limitation from tcp_client (#2790). Thanks @Simon-Janos.
  * Fix android sink when message is not loggable (#2801). Thanks @lucasrangit.
- Removed three patches after update update to 1.12.0 includes these
  * patch 0ca574ae168820da0268b3ec7607ca7b33024d05.patch removed
  * patch v1.11.0_removed_brackets_for_fmt_10.diff removed
  * patch tt4g-fix-2735.diff removed

OBS-URL: https://build.opensuse.org/request/show/1097821
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/spdlog?expand=0&rev=28
This commit is contained in:
Dominique Leuenberger 2023-07-10 14:39:31 +00:00 committed by Git OBS Bridge
commit 5ff9b5e2ca
8 changed files with 54 additions and 318 deletions

View File

@ -1,39 +0,0 @@
From 0ca574ae168820da0268b3ec7607ca7b33024d05 Mon Sep 17 00:00:00 2001
From: H1X4 <10332146+H1X4Dev@users.noreply.github.com>
Date: Fri, 31 Mar 2023 20:39:32 +0300
Subject: [PATCH] fix build for master fmt (non-bundled) (#2694)
* fix build for master fmt (non-bundled)
* update fmt_runtime_string macro
* fix build of updated macro
---
include/spdlog/common.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/spdlog/common.h b/include/spdlog/common.h
index e69201a81..5f671c5c6 100644
--- a/include/spdlog/common.h
+++ b/include/spdlog/common.h
@@ -173,12 +173,19 @@ using format_string_t = fmt::format_string<Args...>;
template<class T>
using remove_cvref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
+template <typename Char>
+#if FMT_VERSION >= 90101
+using fmt_runtime_string = fmt::runtime_format_string<Char>;
+#else
+using fmt_runtime_string = fmt::basic_runtime<Char>;
+#endif
+
// clang doesn't like SFINAE disabled constructor in std::is_convertible<> so have to repeat the condition from basic_format_string here,
// in addition, fmt::basic_runtime<Char> is only convertible to basic_format_string<Char> but not basic_string_view<Char>
template<class T, class Char = char>
struct is_convertible_to_basic_format_string
: std::integral_constant<bool,
- std::is_convertible<T, fmt::basic_string_view<Char>>::value || std::is_same<remove_cvref_t<T>, fmt::basic_runtime<Char>>::value>
+ std::is_convertible<T, fmt::basic_string_view<Char>>::value || std::is_same<remove_cvref_t<T>, fmt_runtime_string<Char>>::value>
{};
# if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT)

View File

@ -1 +1 @@
libspdlog1_11
libspdlog1_12

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ca5cae8d6cac15dae0ec63b21d6ad3530070650f68076f3a4a862ca293a858bb
size 373033

View File

@ -1,3 +1,48 @@
-------------------------------------------------------------------
Sun Jul 9 12:02:44 UTC 2023 - Bernd Ritter <comrad@posteo.de>
- Update to version 1.12.0
* Support for external fmtlib versions 10.x (#2694). Thanks @H1X4Dev and @mguludag.
* Better support for std::format (#2359, #2544, #2680, #2688). Thanks @eli-b , @sylveon and @bachittle.
* Added new qt color sink. Logs to QTextEdit widget with some nice colors.
* Update #include to a deprecated fmt header (#2545) .Thanks @kromain.
* Fixes and impovements to dup_filter_sink (#2549, #2563). Thanks @zydxhs and @zhuyadong.
* Fix unnecessary empty backtrace begin/end logs (#2568). Thanks @koldi.
* Fixed variable name in msvc_sink (#2573). Thanks @naddu77.
* Add system includes (SPDLOG_SYSTEM_INCLUDES) cmake option (#2575). Thanks @dpayne.
* Improve dequeue of the async queue (@2587, #2588 ). Thanks @alokpr.
* Fix tcp_client sink for FreeBSD (#2590). Thanks @segoon.
* Support linux/musl libc (#2589). Thanks @kraj.
* Support newlib C library configurations without tm_gmtoff field (#2600). Thanks @igrr.
* Fix type of event id in win_eventlog_sink (#2598). Thanks @Tagl.
* Fix -Wshadow warnings in spdlog::sinks::dist_sink (#2599). Thanks @robinlinden.
* Spelling corrections (#2606, #2732). Thanks @albert-github and @zencatalyst.
* Add sync() function to file_helper (#2343). Thanks @espkk.
* Add a trivial callback_sink (#2610). Thanks @maghorbani.
* Fix unexpected delimiter at start of line in to_hex formatter (#2627). Thanks @starsunyzl.
* Fix MinGW build issue on example (#2642). Thanks @zEuS0390.
* Add optional TID definition to the systemd sink (#2619). Thanks @chardin-cpi.
* Added apply_logger_env_levels() (#2648, #2649). Thanks @afshinpir.
* Support utf8 in msvc_sink (#2651). Thanks @Demonese.
* Better handling of utf to wchar (66407f5).
* Use catch v3 for tests (#2656, (#2659). Thanks @xvitaly and @seker.
* New kafka sink (#2655). Thanks @vbirds and @SpriteOvO.
* Fix os namespace in systemd_sink.h (#2668). Thanks @MyNameIsLame.
* Enable systemd_sink tests in linux pipeline (#2669). Thanks @MyNameIsLame.
* Fix stdout_sink_base::log's fflush() behaviour inconsistency (#2646). Thanks @25077667.
* Fix for missing pthread_threadid_np in macOS < 10.6 and PowerPC (#2715). Thanks @barracuda156.
* Fix ringbuffer_sink moving warning (#2722). Thanks @jamesruan.
* Update INSTALL doc (#2775). Thanks @7starsea.
* Fix warning in qt_sinks.h (#2781). Thanks @dayfixer.
* Remove IPv4 limitation from tcp_client (#2790). Thanks @Simon-Janos.
* Fix android sink when message is not loggable (#2801). Thanks @lucasrangit.
- Removed three patches after update update to 1.12.0 includes these
* patch 0ca574ae168820da0268b3ec7607ca7b33024d05.patch removed
* patch v1.11.0_removed_brackets_for_fmt_10.diff removed
* patch tt4g-fix-2735.diff removed
-------------------------------------------------------------------
Sat May 20 12:51:48 UTC 2023 - Bernd Ritter <comrad@posteo.de>

View File

@ -17,20 +17,14 @@
Name: spdlog
%define lname libspdlog1_11
%define sover 1.11
Version: 1.11.0
%define lname libspdlog1_12
%define sover 1.12
Version: 1.12.0
Release: 0
Summary: C++ logging library
License: MIT
URL: https://github.com/gabime/spdlog
Source0: https://github.com/gabime/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM 0ca574ae168820da0268b3ec7607ca7b33024d05.patch
Patch0: 0ca574ae168820da0268b3ec7607ca7b33024d05.patch
# PATCH-FIX-UPSTREAM v1.11.0_removed_brackets_for_fmt_10.diff
Patch1: v1.11.0_removed_brackets_for_fmt_10.diff
# PATCH-FIX-UPSTREAM tt4g-fix-2735.diff
Patch2: tt4g-fix-2735.diff
Source0: https://github.com/gabime/%{name}/archive/refs/tags/v%{version}.tar.gz
Source99: baselibs.conf
BuildRequires: cmake >= 3.10
%if 0%{?suse_version} > 1500
@ -40,7 +34,7 @@ BuildRequires: gcc8-c++
%endif
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: (pkgconfig(catch2) >= 2.13.4 with pkgconfig(catch2) < 3)
BuildRequires: (pkgconfig(catch2) >= 3)
BuildRequires: pkgconfig(fmt) >= 8.0.0
BuildRequires: pkgconfig(libsystemd)

View File

@ -1,50 +0,0 @@
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h
index f6f1bb1d..31516ee2 100644
--- a/include/spdlog/sinks/daily_file_sink.h
+++ b/include/spdlog/sinks/daily_file_sink.h
@@ -18,6 +18,7 @@
#include <ctime>
#include <mutex>
#include <string>
+#include <vector>
namespace spdlog {
namespace sinks {
@@ -48,7 +49,6 @@ struct daily_filename_format_calculator
{
static filename_t calc_filename(const filename_t &filename, const tm &now_tm)
{
-#ifdef SPDLOG_USE_STD_FORMAT
// adapted from fmtlib: https://github.com/fmtlib/fmt/blob/8.0.1/include/fmt/chrono.h#L522-L546
filename_t tm_format;
@@ -59,7 +59,7 @@ struct daily_filename_format_calculator
tm_format.push_back(' ');
const size_t MIN_SIZE = 10;
- filename_t buf;
+ std::vector<char> buf;
buf.resize(MIN_SIZE);
for (;;)
{
@@ -73,19 +73,7 @@ struct daily_filename_format_calculator
buf.resize(buf.size() * 2);
}
- return buf;
-#else
- // generate fmt datetime format string, e.g. {:%Y-%m-%d}.
- filename_t fmt_filename = fmt::format(SPDLOG_FMT_STRING(SPDLOG_FILENAME_T("{{:{}}}")), filename);
-
- // MSVC doesn't allow fmt::runtime(..) with wchar, with fmtlib versions < 9.1.x
-# if defined(_MSC_VER) && defined(SPDLOG_WCHAR_FILENAMES) && FMT_VERSION < 90101
- return fmt::format(fmt_filename, now_tm);
-# else
- return fmt::format(SPDLOG_FMT_RUNTIME(fmt_filename), now_tm);
-# endif
-
-#endif
+ return std::string(buf.cbegin(), buf.cend());
}
private:

View File

@ -1,214 +0,0 @@
diff --git a/tests/test_daily_logger.cpp b/tests/test_daily_logger.cpp
index c6e685de..82f28941 100644
--- a/tests/test_daily_logger.cpp
+++ b/tests/test_daily_logger.cpp
@@ -87,19 +87,19 @@ TEST_CASE("daily_logger with custom calculator", "[daily_logger]")
* File name calculations
*/
-TEST_CASE("rotating_file_sink::calc_filename1", "[rotating_file_sink]]")
+TEST_CASE("rotating_file_sink::calc_filename1", "[rotating_file_sink]")
{
auto filename = spdlog::sinks::rotating_file_sink_st::calc_filename(SPDLOG_FILENAME_T("rotated.txt"), 3);
REQUIRE(filename == SPDLOG_FILENAME_T("rotated.3.txt"));
}
-TEST_CASE("rotating_file_sink::calc_filename2", "[rotating_file_sink]]")
+TEST_CASE("rotating_file_sink::calc_filename2", "[rotating_file_sink]")
{
auto filename = spdlog::sinks::rotating_file_sink_st::calc_filename(SPDLOG_FILENAME_T("rotated"), 3);
REQUIRE(filename == SPDLOG_FILENAME_T("rotated.3"));
}
-TEST_CASE("rotating_file_sink::calc_filename3", "[rotating_file_sink]]")
+TEST_CASE("rotating_file_sink::calc_filename3", "[rotating_file_sink]")
{
auto filename = spdlog::sinks::rotating_file_sink_st::calc_filename(SPDLOG_FILENAME_T("rotated.txt"), 0);
REQUIRE(filename == SPDLOG_FILENAME_T("rotated.txt"));
@@ -110,7 +110,7 @@ TEST_CASE("rotating_file_sink::calc_filename3", "[rotating_file_sink]]")
# include <regex>
-TEST_CASE("daily_file_sink::daily_filename_calculator", "[daily_file_sink]]")
+TEST_CASE("daily_file_sink::daily_filename_calculator", "[daily_file_sink]")
{
// daily_YYYY-MM-DD_hh-mm.txt
auto filename =
@@ -123,7 +123,7 @@ TEST_CASE("daily_file_sink::daily_filename_calculator", "[daily_file_sink]]")
}
#endif
-TEST_CASE("daily_file_sink::daily_filename_format_calculator", "[daily_file_sink]]")
+TEST_CASE("daily_file_sink::daily_filename_format_calculator", "[daily_file_sink]")
{
std::tm tm = spdlog::details::os::localtime();
// example-YYYY-MM-DD.log
diff --git a/tests/test_errors.cpp b/tests/test_errors.cpp
index 896e5b0a..939f1aeb 100644
--- a/tests/test_errors.cpp
+++ b/tests/test_errors.cpp
@@ -22,7 +22,7 @@ protected:
}
};
-TEST_CASE("default_error_handler", "[errors]]")
+TEST_CASE("default_error_handler", "[errors]")
{
prepare_logdir();
spdlog::filename_t filename = SPDLOG_FILENAME_T(SIMPLE_LOG);
@@ -40,7 +40,7 @@ TEST_CASE("default_error_handler", "[errors]]")
struct custom_ex
{};
-TEST_CASE("custom_error_handler", "[errors]]")
+TEST_CASE("custom_error_handler", "[errors]")
{
prepare_logdir();
spdlog::filename_t filename = SPDLOG_FILENAME_T(SIMPLE_LOG);
@@ -54,7 +54,7 @@ TEST_CASE("custom_error_handler", "[errors]]")
require_message_count(SIMPLE_LOG, 2);
}
-TEST_CASE("default_error_handler2", "[errors]]")
+TEST_CASE("default_error_handler2", "[errors]")
{
spdlog::drop_all();
auto logger = spdlog::create<failing_sink>("failed_logger");
@@ -62,7 +62,7 @@ TEST_CASE("default_error_handler2", "[errors]]")
REQUIRE_THROWS_AS(logger->info("Some message"), custom_ex);
}
-TEST_CASE("flush_error_handler", "[errors]]")
+TEST_CASE("flush_error_handler", "[errors]")
{
spdlog::drop_all();
auto logger = spdlog::create<failing_sink>("failed_logger");
@@ -70,7 +70,7 @@ TEST_CASE("flush_error_handler", "[errors]]")
REQUIRE_THROWS_AS(logger->flush(), custom_ex);
}
-TEST_CASE("async_error_handler", "[errors]]")
+TEST_CASE("async_error_handler", "[errors]")
{
prepare_logdir();
std::string err_msg("log failed with some msg");
@@ -98,7 +98,7 @@ TEST_CASE("async_error_handler", "[errors]]")
}
// Make sure async error handler is executed
-TEST_CASE("async_error_handler2", "[errors]]")
+TEST_CASE("async_error_handler2", "[errors]")
{
prepare_logdir();
std::string err_msg("This is async handler error message");
diff --git a/tests/test_file_helper.cpp b/tests/test_file_helper.cpp
index 1d947078..dd3ca4f8 100644
--- a/tests/test_file_helper.cpp
+++ b/tests/test_file_helper.cpp
@@ -15,7 +15,7 @@ static void write_with_helper(file_helper &helper, size_t howmany)
helper.flush();
}
-TEST_CASE("file_helper_filename", "[file_helper::filename()]]")
+TEST_CASE("file_helper_filename", "[file_helper::filename()]")
{
prepare_logdir();
@@ -25,7 +25,7 @@ TEST_CASE("file_helper_filename", "[file_helper::filename()]]")
REQUIRE(helper.filename() == target_filename);
}
-TEST_CASE("file_helper_size", "[file_helper::size()]]")
+TEST_CASE("file_helper_size", "[file_helper::size()]")
{
prepare_logdir();
spdlog::filename_t target_filename = SPDLOG_FILENAME_T(TEST_FILENAME);
@@ -39,7 +39,7 @@ TEST_CASE("file_helper_size", "[file_helper::size()]]")
REQUIRE(get_filesize(TEST_FILENAME) == expected_size);
}
-TEST_CASE("file_helper_reopen", "[file_helper::reopen()]]")
+TEST_CASE("file_helper_reopen", "[file_helper::reopen()]")
{
prepare_logdir();
spdlog::filename_t target_filename = SPDLOG_FILENAME_T(TEST_FILENAME);
@@ -51,7 +51,7 @@ TEST_CASE("file_helper_reopen", "[file_helper::reopen()]]")
REQUIRE(helper.size() == 0);
}
-TEST_CASE("file_helper_reopen2", "[file_helper::reopen(false)]]")
+TEST_CASE("file_helper_reopen2", "[file_helper::reopen(false)]")
{
prepare_logdir();
spdlog::filename_t target_filename = SPDLOG_FILENAME_T(TEST_FILENAME);
@@ -78,7 +78,7 @@ static void test_split_ext(const spdlog::filename_t::value_type *fname, const sp
REQUIRE(ext == expected_ext);
}
-TEST_CASE("file_helper_split_by_extension", "[file_helper::split_by_extension()]]")
+TEST_CASE("file_helper_split_by_extension", "[file_helper::split_by_extension()]")
{
test_split_ext(SPDLOG_FILENAME_T("mylog.txt"), SPDLOG_FILENAME_T("mylog"), SPDLOG_FILENAME_T(".txt"));
test_split_ext(SPDLOG_FILENAME_T(".mylog.txt"), SPDLOG_FILENAME_T(".mylog"), SPDLOG_FILENAME_T(".txt"));
diff --git a/tests/test_file_logging.cpp b/tests/test_file_logging.cpp
index 1c7a1853..7a7119ad 100644
--- a/tests/test_file_logging.cpp
+++ b/tests/test_file_logging.cpp
@@ -6,7 +6,7 @@
#define SIMPLE_LOG "test_logs/simple_log"
#define ROTATING_LOG "test_logs/rotating_log"
-TEST_CASE("simple_file_logger", "[simple_logger]]")
+TEST_CASE("simple_file_logger", "[simple_logger]")
{
prepare_logdir();
spdlog::filename_t filename = SPDLOG_FILENAME_T(SIMPLE_LOG);
@@ -23,7 +23,7 @@ TEST_CASE("simple_file_logger", "[simple_logger]]")
REQUIRE(file_contents(SIMPLE_LOG) == spdlog::fmt_lib::format("Test message 1{}Test message 2{}", default_eol, default_eol));
}
-TEST_CASE("flush_on", "[flush_on]]")
+TEST_CASE("flush_on", "[flush_on]")
{
prepare_logdir();
spdlog::filename_t filename = SPDLOG_FILENAME_T(SIMPLE_LOG);
@@ -44,7 +44,7 @@ TEST_CASE("flush_on", "[flush_on]]")
spdlog::fmt_lib::format("Should not be flushed{}Test message 1{}Test message 2{}", default_eol, default_eol, default_eol));
}
-TEST_CASE("rotating_file_logger1", "[rotating_logger]]")
+TEST_CASE("rotating_file_logger1", "[rotating_logger]")
{
prepare_logdir();
size_t max_size = 1024 * 10;
@@ -60,7 +60,7 @@ TEST_CASE("rotating_file_logger1", "[rotating_logger]]")
require_message_count(ROTATING_LOG, 10);
}
-TEST_CASE("rotating_file_logger2", "[rotating_logger]]")
+TEST_CASE("rotating_file_logger2", "[rotating_logger]")
{
prepare_logdir();
size_t max_size = 1024 * 10;
@@ -100,7 +100,7 @@ TEST_CASE("rotating_file_logger2", "[rotating_logger]]")
}
// test that passing max_size=0 throws
-TEST_CASE("rotating_file_logger3", "[rotating_logger]]")
+TEST_CASE("rotating_file_logger3", "[rotating_logger]")
{
prepare_logdir();
size_t max_size = 0;
diff --git a/tests/test_macros.cpp b/tests/test_macros.cpp
index 2aeeecff..36537958 100644
--- a/tests/test_macros.cpp
+++ b/tests/test_macros.cpp
@@ -10,7 +10,7 @@
#define TEST_FILENAME "test_logs/simple_log"
-TEST_CASE("debug and trace w/o format string", "[macros]]")
+TEST_CASE("debug and trace w/o format string", "[macros]")
{
prepare_logdir();

BIN
v1.12.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.