Skip to content

Commit

Permalink
Clang-tidy: fix misc-non-private-member-variables-in-classes warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Artsishevsky <polter.rnd@gmail.com>
  • Loading branch information
polter-rnd committed Sep 30, 2024
1 parent 365b119 commit 0cd7e14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
14 changes: 3 additions & 11 deletions include/log/record.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,9 @@ RecordStringView(const Char*, size_t) -> RecordStringView<Char>;
template<typename Char, typename StringType>
struct Record {
struct Location {
// NOLINTNEXTLINE(*-explicit-conversions)
Location(Log::Location location)
: filename(location.file_name())
, function(location.function_name())
, line(location.line())
{
}

RecordStringView<char> filename;
RecordStringView<char> function;
size_t line;
RecordStringView<char> filename = {};
RecordStringView<char> function = {};
size_t line = {};
};

Level level = {};
Expand Down
5 changes: 4 additions & 1 deletion include/log/sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ class SinkDriver<Logger, SingleThreadedPolicy> {
Args&&... args) const -> void
{
FormatBufferType buffer;
RecordType record = {level, location, std::move(category)};
RecordType record
= {level,
{location.file_name(), location.function_name(), location.line()},
std::move(category)};

// Flag to check that message has been evaluated
bool evaluated = false;
Expand Down

0 comments on commit 0cd7e14

Please sign in to comment.