[med-svn] [Git][med-team/spdlog][master] 4 commits: New upstream version 1.15.2+ds
Shengqi Chen (@harry)
gitlab at salsa.debian.org
Mon Apr 7 16:41:58 BST 2025
Shengqi Chen pushed to branch master at Debian Med / spdlog
Commits:
c212a43c by Shengqi Chen at 2025-04-07T23:35:03+08:00
New upstream version 1.15.2+ds
- - - - -
0f3d1050 by Shengqi Chen at 2025-04-07T23:35:03+08:00
Update upstream source from tag 'upstream/1.15.2+ds'
Update to upstream version '1.15.2+ds'
with Debian dir d650cb5711ac705e73c1ea82a10a25c0fcb2491e
- - - - -
0ac6acf0 by Shengqi Chen at 2025-04-07T23:37:30+08:00
d/control: bump std-ver to 4.7.2 (no changes required)
Signed-off-by: Shengqi Chen <harry-chen at outlook.com>
- - - - -
aea6c2cf by Shengqi Chen at 2025-04-07T23:41:38+08:00
Gbp-Dch: update and upload 1.15.2+ds-1 to unstable
Signed-off-by: Shengqi Chen <harry-chen at outlook.com>
- - - - -
7 changed files:
- README.md
- debian/changelog
- debian/control
- include/spdlog/details/os-inl.h
- include/spdlog/pattern_formatter-inl.h
- include/spdlog/version.h
- tests/test_pattern_formatter.cpp
Changes:
=====================================
README.md
=====================================
@@ -36,6 +36,7 @@ see example [CMakeLists.txt](https://github.com/gabime/spdlog/blob/v1.x/example/
* Gentoo: `emerge dev-libs/spdlog`
* Arch Linux: `pacman -S spdlog`
* openSUSE: `sudo zypper in spdlog-devel`
+* ALT Linux: `apt-get install libspdlog-devel`
* vcpkg: `vcpkg install spdlog`
* conan: `conan install --requires=spdlog/[*]`
* conda: `conda install -c conda-forge spdlog`
=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+spdlog (1:1.15.2+ds-1) unstable; urgency=medium
+
+ * Team upload.
+ * New upstream version 1.15.2+ds.
+ * d/control: bump std-ver to 4.7.2 (no changes required).
+
+ -- Shengqi Chen <harry at debian.org> Mon, 07 Apr 2025 23:35:35 +0800
+
spdlog (1:1.15.1+ds-1) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -11,7 +11,7 @@ Build-Depends: debhelper-compat (= 13),
pkg-kde-tools,
libsystemd-dev [linux-any] <!nocheck>,
catch2 (>= 3.0.0) <!nocheck>
-Standards-Version: 4.7.0
+Standards-Version: 4.7.2
Vcs-Browser: https://salsa.debian.org/med-team/spdlog
Vcs-Git: https://salsa.debian.org/med-team/spdlog.git
Homepage: https://github.com/gabime/spdlog
=====================================
include/spdlog/details/os-inl.h
=====================================
@@ -267,7 +267,8 @@ SPDLOG_INLINE int utc_minutes_offset(const std::tm &tm) {
#if defined(sun) || defined(__sun) || defined(_AIX) || \
(defined(__NEWLIB__) && !defined(__TM_GMTOFF)) || \
- (!defined(_BSD_SOURCE) && !defined(_GNU_SOURCE))
+ (!defined(__APPLE__) && !defined(_BSD_SOURCE) && !defined(_GNU_SOURCE) && \
+ (!defined(_POSIX_VERSION) || (_POSIX_VERSION < 202405L)))
// 'tm_gmtoff' field is BSD extension and it's missing on SunOS/Solaris
struct helper {
static long int calculate_gmt_offset(const std::tm &localtm = details::os::localtime(),
=====================================
include/spdlog/pattern_formatter-inl.h
=====================================
@@ -70,6 +70,9 @@ public:
pad_it(remaining_pad_);
} else if (padinfo_.truncate_) {
long new_size = static_cast<long>(dest_.size()) + remaining_pad_;
+ if (new_size < 0) {
+ new_size = 0;
+ }
dest_.resize(static_cast<size_t>(new_size));
}
}
@@ -264,7 +267,7 @@ public:
: flag_formatter(padinfo) {}
void format(const details::log_msg &, const std::tm &tm_time, memory_buf_t &dest) override {
- const size_t field_size = 10;
+ const size_t field_size = 8;
ScopedPadder p(field_size, padinfo_, dest);
fmt_helper::pad2(tm_time.tm_mon + 1, dest);
@@ -926,9 +929,8 @@ private:
memory_buf_t cached_datetime_;
#ifndef SPDLOG_NO_TLS
- mdc_formatter<null_scoped_padder> mdc_formatter_{padding_info{}};
+ mdc_formatter<null_scoped_padder> mdc_formatter_{padding_info {}};
#endif
-
};
} // namespace details
=====================================
include/spdlog/version.h
=====================================
@@ -5,7 +5,7 @@
#define SPDLOG_VER_MAJOR 1
#define SPDLOG_VER_MINOR 15
-#define SPDLOG_VER_PATCH 1
+#define SPDLOG_VER_PATCH 2
#define SPDLOG_TO_VERSION(major, minor, patch) (major * 10000 + minor * 100 + patch)
#define SPDLOG_VERSION SPDLOG_TO_VERSION(SPDLOG_VER_MAJOR, SPDLOG_VER_MINOR, SPDLOG_VER_PATCH)
=====================================
tests/test_pattern_formatter.cpp
=====================================
@@ -1,6 +1,8 @@
#include "includes.h"
#include "test_sink.h"
+#include <chrono>
+
using spdlog::memory_buf_t;
using spdlog::details::to_string_view;
@@ -19,6 +21,21 @@ static std::string log_to_str(const std::string &msg, const Args &...args) {
return oss.str();
}
+// log to str and return it with time
+template <typename... Args>
+static std::string log_to_str_with_time(spdlog::log_clock::time_point log_time, const std::string &msg, const Args &...args) {
+ std::ostringstream oss;
+ auto oss_sink = std::make_shared<spdlog::sinks::ostream_sink_mt>(oss);
+ spdlog::logger oss_logger("pattern_tester", oss_sink);
+ oss_logger.set_level(spdlog::level::info);
+
+ oss_logger.set_formatter(
+ std::unique_ptr<spdlog::formatter>(new spdlog::pattern_formatter(args...)));
+
+ oss_logger.log(log_time, {}, spdlog::level::info, msg);
+ return oss.str();
+}
+
TEST_CASE("custom eol", "[pattern_formatter]") {
std::string msg = "Hello custom eol test";
std::string eol = ";)";
@@ -58,6 +75,15 @@ TEST_CASE("date MM/DD/YY ", "[pattern_formatter]") {
oss.str());
}
+TEST_CASE("GMT offset ", "[pattern_formatter]") {
+ using namespace std::chrono_literals;
+ const auto now = std::chrono::system_clock::now();
+ const auto yesterday = now - 24h;
+
+ REQUIRE(log_to_str_with_time(yesterday, "Some message", "%z", spdlog::pattern_time_type::utc, "\n") ==
+ "+00:00\n");
+}
+
TEST_CASE("color range test1", "[pattern_formatter]") {
auto formatter = std::make_shared<spdlog::pattern_formatter>(
"%^%v%$", spdlog::pattern_time_type::local, "\n");
View it on GitLab: https://salsa.debian.org/med-team/spdlog/-/compare/bc868db068481bb785d310b2565c3b9b56111ba3...aea6c2cf0feaeb4a43a5b6573ba9fe808af0b7f2
--
View it on GitLab: https://salsa.debian.org/med-team/spdlog/-/compare/bc868db068481bb785d310b2565c3b9b56111ba3...aea6c2cf0feaeb4a43a5b6573ba9fe808af0b7f2
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20250407/b83ed7f2/attachment-0001.htm>
More information about the debian-med-commit
mailing list