From 50a6d1a074f985192453f0087eccf1ab208e4e05 Mon Sep 17 00:00:00 2001 From: Ivan Chikish Date: Sat, 15 Jul 2023 09:25:22 +0300 Subject: [PATCH] [Logs] Use std::string_view for msg --- orbis-kernel/include/orbis/utils/Logs.hpp | 6 +++--- orbis-kernel/src/utils/Logs.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/orbis-kernel/include/orbis/utils/Logs.hpp b/orbis-kernel/include/orbis/utils/Logs.hpp index 7fb22e84..deca579f 100644 --- a/orbis-kernel/include/orbis/utils/Logs.hpp +++ b/orbis-kernel/include/orbis/utils/Logs.hpp @@ -88,11 +88,11 @@ template constexpr const log_type_info type_info_v[sizeof...(Args) + 1]{ log_type_info::make>()...}; -void _orbis_log_print(LogLevel lvl, const char *msg, std::string_view names, - const log_type_info *sup, ...); +void _orbis_log_print(LogLevel lvl, std::string_view msg, + std::string_view names, const log_type_info *sup, ...); template -void _orbis_log_impl(LogLevel lvl, const char *msg, const char *names, +void _orbis_log_impl(LogLevel lvl, std::string_view msg, std::string_view names, const Args &...args) { // Fast filtering if (logs_level.load(std::memory_order::relaxed) < lvl) diff --git a/orbis-kernel/src/utils/Logs.cpp b/orbis-kernel/src/utils/Logs.cpp index fb86557f..1612b5bc 100644 --- a/orbis-kernel/src/utils/Logs.cpp +++ b/orbis-kernel/src/utils/Logs.cpp @@ -168,8 +168,8 @@ void log_class_string::format(std::string &out, const void *arg) { out += get_object(arg) ? "1" : "0"; } -void _orbis_log_print(LogLevel lvl, const char *msg, std::string_view names, - const log_type_info *sup, ...) { +void _orbis_log_print(LogLevel lvl, std::string_view msg, + std::string_view names, const log_type_info *sup, ...) { if (lvl > logs_level.load(std::memory_order::relaxed)) { return; }