Skip to content

Commit af4d374

Browse files
committed
support char* logging argument to avoid build error
1 parent 69023b4 commit af4d374

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v1.0.0.5 - 10-03-2025
2+
- Support char* logging argument to avoid build error.
3+
14
# v1.0.0.4 - 10-02-2025
25
- Fix critical DailyFileSink bug: prevent file overwrites on program restart
36
- Remove current_day_index_ member to eliminate restart index reset issue

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.20)
22

3-
set(BUILD_VERSION 1.0.0.4)
3+
set(BUILD_VERSION 1.0.0.5)
44
project(slick_logger VERSION ${BUILD_VERSION} LANGUAGES CXX)
55

66
set(CMAKE_CXX_STANDARD 20)

include/slick_logger/logger.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
#define SLICK_LOGGER_VERSION_MAJOR 1
5757
#define SLICK_LOGGER_VERSION_MINOR 0
5858
#define SLICK_LOGGER_VERSION_PATCH 0
59-
#define SLICK_LOGGER_VERSION_TWEAK 3
60-
#define SLICK_LOGGER_VERSION "1.0.0.3"
59+
#define SLICK_LOGGER_VERSION_TWEAK 5
60+
#define SLICK_LOGGER_VERSION "1.0.0.5"
6161

6262
#ifndef SLICK_LOGGER_MAX_ARGS
6363
#define SLICK_LOGGER_MAX_ARGS 20
@@ -1543,6 +1543,11 @@ inline void Logger::enqueue_argument(LogArgument& arg, T&& value) {
15431543
arg.type = ArgType::STRING_DYNAMIC;
15441544
arg.value.dynamic_str = store_string_in_queue(value);
15451545
}
1546+
else if constexpr (std::is_same_v<DecayedT, char*>) {
1547+
// Assume string literal - store pointer directly
1548+
arg.type = ArgType::STRING_DYNAMIC;
1549+
arg.value.dynamic_str = store_string_in_queue(value);
1550+
}
15461551
else if constexpr (std::is_same_v<DecayedT, std::string>) {
15471552
// Dynamic string - copy to string queue
15481553
arg.type = ArgType::STRING_DYNAMIC;

src/logger.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,11 @@ inline void Logger::enqueue_argument(LogArgument& arg, T&& value) {
15411541
arg.type = ArgType::STRING_DYNAMIC;
15421542
arg.value.dynamic_str = store_string_in_queue(value);
15431543
}
1544+
else if constexpr (std::is_same_v<DecayedT, char*>) {
1545+
// Assume string literal - store pointer directly
1546+
arg.type = ArgType::STRING_DYNAMIC;
1547+
arg.value.dynamic_str = store_string_in_queue(value);
1548+
}
15441549
else if constexpr (std::is_same_v<DecayedT, std::string>) {
15451550
// Dynamic string - copy to string queue
15461551
arg.type = ArgType::STRING_DYNAMIC;

0 commit comments

Comments
 (0)