Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new-core-alignment] proto file cleanups part 2 (logging) #1361

Merged
merged 5 commits into from
Feb 13, 2024

Conversation

rex-schilasky
Copy link
Contributor

Description

  • deprecated ecal/pb API removed
  • monitoring.proto split into monitoring and logging part (fully compatible to eCAL5)
  • renaming eCAL::pb::Logging to eCAL::pb::LogMessageList (like eCAL::pb::SampleList)

Cherry-pick to

  • none

…ible to eCAL5)

deprecated ecal/pb API removed
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

{
int inserted_row_count = logging_pb.logs().size();
int inserted_row_count = logging_pb.log_messages().size();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'inserted_row_count' of type 'int' can be declared 'const' [misc-const-correctness]

Suggested change
int inserted_row_count = logging_pb.log_messages().size();
{const

@@ -244,7 +244,7 @@
beginInsertRows(QModelIndex(), size_before, size_after - 1);

int counter = inserted_row_count;
for (auto& log_message_pb : logging_pb.logs())
for (auto& log_message_pb : logging_pb.log_messages())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'auto &log_message_pb' can be declared as 'const auto &log_message_pb' [readability-qualified-auto]

Suggested change
for (auto& log_message_pb : logging_pb.log_messages())
;const

@@ -73,7 +73,7 @@ class LogModel : public QAbstractItemModel
QModelIndex parent(const QModelIndex &index) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;

void insertLogs(const eCAL::pb::Logging& logs);
void insertLogs(const eCAL::pb::LogMessageList& logs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'LogModel::insertLogs' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

         ^
Additional context

app/mon/mon_gui/src/widgets/models/log_model.cpp:216: the definition seen here

                 ^

app/mon/mon_gui/src/widgets/models/log_model.h:75: differing parameters are named here: ('logs'), in definition: ('logging_pb')

         ^

@@ -113,7 +113,7 @@ class LogModel
eCAL::Monitoring::GetLogging(raw_data);
logs.ParseFromString(raw_data);

auto &pb_logs = logs.logs();
auto &pb_logs = logs.log_messages();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'auto &pb_logs' can be declared as 'const auto &pb_logs' [readability-qualified-auto]

Suggested change
auto &pb_logs = logs.log_messages();
const auto &pb_logs = logs.log_messages();

@@ -126,7 +126,7 @@
{
data.erase(data.begin(), data.begin() + overflow_size);
}
for(auto &l: logs.logs()) data.push_back(ToLogEntry(l));
for(auto &l: logs.log_messages()) data.push_back(ToLogEntry(l));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'auto &l' can be declared as 'const auto &l' [readability-qualified-auto]

Suggested change
for(auto &l: logs.log_messages()) data.push_back(ToLogEntry(l));
for(const auto &l: logs.log_messages()) data.push_back(ToLogEntry(l));

@@ -1535,15 +1536,15 @@ PyObject* mon_logging(PyObject* /*self*/, PyObject* /*args*/)
std::string logging_s;
if (eCAL::Monitoring::GetLogging(logging_s))
{
eCAL::pb::Logging logging;
eCAL::pb::LogMessageList logging;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'logging' of type 'eCAL::pb::LogMessageList' can be declared 'const' [misc-const-correctness]

Suggested change
eCAL::pb::LogMessageList logging;
eCAL::pb::LogMessageList const logging;

@rex-schilasky rex-schilasky changed the title [new-core-alignment] proto file cleanups part 2 [new-core-alignment] proto file cleanups part 2 (looging) Feb 12, 2024
@rex-schilasky rex-schilasky changed the title [new-core-alignment] proto file cleanups part 2 (looging) [new-core-alignment] proto file cleanups part 2 (logging) Feb 12, 2024
Copy link
Contributor

@KerstinKeller KerstinKeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes a lot of sense to move the logging to another file, though I am not 100% if the renaming is necessary / will lead to conflicts / user code changes.


message LogMessageList // eCAL log message list
{
repeated LogMessage log_messages = 1; // log messages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need the renaming? It's a bit nicer but not sure if it's strictly necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But much nicer :-)

@rex-schilasky rex-schilasky merged commit e88a6a3 into master Feb 13, 2024
14 checks passed
@rex-schilasky rex-schilasky deleted the new-core-alignment/proto-file-cleanup2 branch February 13, 2024 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants