fix clang-tidy errors

This commit is contained in:
JCW
2026-05-01 13:21:10 +01:00
parent ed7a936e1f
commit ed15220901
2 changed files with 12 additions and 4 deletions

View File

@@ -94,9 +94,9 @@ defaultJsonLogFormat()
struct LoggingConfiguration
{
bool enableConsole{};
std::optional<std::string> directory;
std::optional<std::string> directory{std::nullopt};
bool isAsync{};
Severity defaultSeverity;
Severity defaultSeverity{Severity::DBG};
bool jsonMode{false};
};
@@ -223,7 +223,7 @@ class Logger
if (jsonMode_)
{
detail::appendJsonField(messageParams_, p.name(), p.value());
detail::appendJsonField(messageParams_, p.name(), std::move(p).value());
}
return *this;

View File

@@ -179,10 +179,17 @@ public:
/** @brief Get the parameter value. */
[[nodiscard]] T const&
value() const
value() const&
{
return value_;
}
/** @brief Get the parameter value. */
[[nodiscard]] T&&
value() &&
{
return std::move(value_);
}
};
/**
@@ -231,6 +238,7 @@ template <typename... Ts>
[[nodiscard]] std::string
buildJsonPattern(std::string_view existingPattern, log::Parameter<Ts> const&... params)
{
// NOLINTNEXTLINE(misc-const-correctness)
detail::JsonLoggingPatternBuilder builder(existingPattern);
(builder.add(params.name(), params.value()), ...);
return builder.build();