Skip to content

Commit

Permalink
Pass format arguments as reference-to-const
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-johansson committed May 18, 2024
1 parent 21e699e commit 8b14bc9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions source/core/inc/tactile/core/log/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

#pragma once

#include <format> // format_string, make_format_args, format_args
#include <utility> // forward
#include <format> // format_string, make_format_args, format_args

#include "tactile/base/container/maybe.hpp"
#include "tactile/base/container/smart_ptr.hpp"
Expand Down Expand Up @@ -70,9 +69,9 @@ class Logger final
template <typename... Args>
void log(const LogLevel level,
const std::format_string<Args...> fmt,
Args&&... args) noexcept
const Args&... args) noexcept
{
_log(level, fmt.get(), std::make_format_args(std::forward<Args>(args)...));
_log(level, fmt.get(), std::make_format_args(args...));
}

/**
Expand Down Expand Up @@ -157,7 +156,7 @@ class Logger final
LogLevel mFlushLevel {LogLevel::kError};
Vector<Unique<ILogSink>> mSinks {};
Maybe<SteadyClockInstant> mReferenceInstant {};
StringView mScope {""};
StringView mScope {};

void _log(LogLevel level,
StringView fmt_string,
Expand Down

0 comments on commit 8b14bc9

Please sign in to comment.