Skip to content

Commit

Permalink
[Logs] Use std::string_view for msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotekina committed Jul 15, 2023
1 parent 86d059d commit 50a6d1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions orbis-kernel/include/orbis/utils/Logs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ template <typename... Args>
constexpr const log_type_info type_info_v[sizeof...(Args) + 1]{
log_type_info::make<std::remove_cvref_t<Args>>()...};

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 <typename... Args>
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)
Expand Down
4 changes: 2 additions & 2 deletions orbis-kernel/src/utils/Logs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ void log_class_string<bool>::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;
}
Expand Down

0 comments on commit 50a6d1a

Please sign in to comment.