Skip to content

Commit b65f228

Browse files
committed
upgrade slick_queue
1 parent 1ddea18 commit b65f228

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
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.3 - 10-01-2025
2+
- upgrade slick_queue to v1.0.2.1
3+
14
# v1.0.0.2 - 09-29-2025
25
- upgrade slick_queue to v1.0.2.0
36

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
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.2)
3+
set(BUILD_VERSION 1.0.0.3)
44
project(slick_logger VERSION ${BUILD_VERSION} LANGUAGES CXX)
55

66
set(CMAKE_CXX_STANDARD 20)
@@ -13,7 +13,7 @@ set(BUILD_SLICK_QUEUE_TESTS OFF CACHE BOOL "" FORCE)
1313
FetchContent_Declare(
1414
slick_queue
1515
GIT_REPOSITORY https://github.com/SlickQuant/slick_queue.git
16-
GIT_TAG v1.0.2.0
16+
GIT_TAG v1.0.2.1
1717
)
1818
FetchContent_MakeAvailable(slick_queue)
1919

include/slick_logger/logger.hpp

Lines changed: 6 additions & 6 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 2
60-
#define SLICK_LOGGER_VERSION "1.0.0.2"
59+
#define SLICK_LOGGER_VERSION_TWEAK 3
60+
#define SLICK_LOGGER_VERSION "1.0.0.3"
6161

6262
#ifndef SLICK_LOGGER_MAX_ARGS
6363
#define SLICK_LOGGER_MAX_ARGS 20
@@ -624,7 +624,7 @@ class Logger {
624624
template<typename T>
625625
void enqueue_argument(LogArgument& arg, T&& value);
626626

627-
StringRef store_string_in_queue(const std::string& str);
627+
StringRef store_string_in_queue(std::string_view str);
628628

629629
std::unique_ptr<slick::SlickQueue<LogEntry>> log_queue_;
630630
std::unique_ptr<slick::SlickQueue<char>> string_queue_;
@@ -1414,7 +1414,7 @@ inline void Logger::enqueue_argument(LogArgument& arg, T&& value) {
14141414
else if constexpr (std::is_same_v<DecayedT, std::string_view>) {
14151415
// Could be either - need to determine at runtime or copy to be safe
14161416
arg.type = ArgType::STRING_DYNAMIC;
1417-
arg.value.dynamic_str = store_string_in_queue(std::string{value});
1417+
arg.value.dynamic_str = store_string_in_queue(value);
14181418
}
14191419
else if constexpr (std::is_pointer_v<DecayedT>) {
14201420
arg.type = ArgType::PTR;
@@ -1427,15 +1427,15 @@ inline void Logger::enqueue_argument(LogArgument& arg, T&& value) {
14271427
}
14281428
}
14291429

1430-
inline StringRef Logger::store_string_in_queue(const std::string& str) {
1430+
inline StringRef Logger::store_string_in_queue(std::string_view str) {
14311431
uint32_t length = str.length();
14321432
auto len = length + 1; // +1 for null terminator
14331433

14341434
// Reserve space in string queue
14351435
uint64_t start_index = string_queue_->reserve(len);
14361436
// Copy string data
14371437
char* dest = (*string_queue_)[start_index];
1438-
std::memcpy(dest, str.c_str(), len);
1438+
std::memcpy(dest, str.data(), len);
14391439

14401440
// Publish the string data
14411441
string_queue_->publish(start_index, len);

src/logger.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ class Logger {
622622
template<typename T>
623623
void enqueue_argument(LogArgument& arg, T&& value);
624624

625-
StringRef store_string_in_queue(const std::string& str);
625+
StringRef store_string_in_queue(std::string_view str);
626626

627627
std::unique_ptr<slick::SlickQueue<LogEntry>> log_queue_;
628628
std::unique_ptr<slick::SlickQueue<char>> string_queue_;
@@ -1412,7 +1412,7 @@ inline void Logger::enqueue_argument(LogArgument& arg, T&& value) {
14121412
else if constexpr (std::is_same_v<DecayedT, std::string_view>) {
14131413
// Could be either - need to determine at runtime or copy to be safe
14141414
arg.type = ArgType::STRING_DYNAMIC;
1415-
arg.value.dynamic_str = store_string_in_queue(std::string{value});
1415+
arg.value.dynamic_str = store_string_in_queue(value);
14161416
}
14171417
else if constexpr (std::is_pointer_v<DecayedT>) {
14181418
arg.type = ArgType::PTR;
@@ -1425,15 +1425,15 @@ inline void Logger::enqueue_argument(LogArgument& arg, T&& value) {
14251425
}
14261426
}
14271427

1428-
inline StringRef Logger::store_string_in_queue(const std::string& str) {
1428+
inline StringRef Logger::store_string_in_queue(std::string_view str) {
14291429
uint32_t length = str.length();
14301430
auto len = length + 1; // +1 for null terminator
14311431

14321432
// Reserve space in string queue
14331433
uint64_t start_index = string_queue_->reserve(len);
14341434
// Copy string data
14351435
char* dest = (*string_queue_)[start_index];
1436-
std::memcpy(dest, str.c_str(), len);
1436+
std::memcpy(dest, str.data(), len);
14371437

14381438
// Publish the string data
14391439
string_queue_->publish(start_index, len);

0 commit comments

Comments
 (0)