-
Notifications
You must be signed in to change notification settings - Fork 181
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
Conversation
…ible to eCAL5) deprecated ecal/pb API removed
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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]
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()) |
There was a problem hiding this comment.
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]
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); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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]
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)); |
There was a problem hiding this comment.
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]
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; |
There was a problem hiding this comment.
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]
eCAL::pb::LogMessageList logging; | |
eCAL::pb::LogMessageList const logging; |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But much nicer :-)
Description
Cherry-pick to