-
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
Changes from all commits
eb6b5d6
dc9e447
b1e85db
26af684
fdaabdb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -214,9 +214,9 @@ Qt::ItemFlags LogModel::flags(const QModelIndex &index) const | |||||
return QAbstractItemModel::flags(index); | ||||||
} | ||||||
|
||||||
void LogModel::insertLogs(const eCAL::pb::Logging& logging_pb) | ||||||
void LogModel::insertLogs(const eCAL::pb::LogMessageList& logging_pb) | ||||||
{ | ||||||
int inserted_row_count = logging_pb.logs().size(); | ||||||
int inserted_row_count = logging_pb.log_messages().size(); | ||||||
int size_before = logs_.size(); | ||||||
|
||||||
// Remove entries from the top | ||||||
|
@@ -244,7 +244,7 @@ void LogModel::insertLogs(const eCAL::pb::Logging& logging_pb) | |||||
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 commentThe 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
|
||||||
{ | ||||||
if (counter <= max_entries_) | ||||||
{ | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ | |
#pragma warning(push) | ||
#pragma warning(disable: 4100 4127 4146 4505 4800 4189 4592) // disable proto warnings | ||
#endif | ||
#include <ecal/core/pb/monitoring.pb.h> | ||
#include <ecal/core/pb/logging.pb.h> | ||
#ifdef _MSC_VER | ||
#pragma warning(pop) | ||
#endif | ||
|
@@ -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 commentThe 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 contextapp/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') ^ |
||
|
||
void setParseTimeEnabled(bool enabled); | ||
bool isParseTimeEnabled() const; | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -25,7 +25,7 @@ | |||||
#ifdef _MSC_VER | ||||||
#pragma warning(push, 0) // disable proto warnings | ||||||
#endif | ||||||
#include "ecal/core/pb/monitoring.pb.h" | ||||||
#include <ecal/core/pb/logging.pb.h> | ||||||
#ifdef _MSC_VER | ||||||
#pragma warning(pop) | ||||||
#endif | ||||||
|
@@ -53,7 +53,7 @@ class LogModel | |||||
bool is_polling; | ||||||
int capacity = 500; | ||||||
|
||||||
eCAL::pb::Logging logs; | ||||||
eCAL::pb::LogMessageList logs; | ||||||
|
||||||
std::mutex mtx; | ||||||
std::thread update_thread; | ||||||
|
@@ -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 commentThe 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 new_entries_count = pb_logs.size(); | ||||||
if(new_entries_count == 0) | ||||||
{ | ||||||
|
@@ -126,7 +126,7 @@ class LogModel | |||||
{ | ||||||
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 commentThe 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
|
||||||
} | ||||||
|
||||||
NotifyUpdate(); | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,13 +17,22 @@ | |
* ========================= eCAL LICENSE ================================= | ||
*/ | ||
|
||
#pragma once | ||
syntax = "proto3"; | ||
|
||
#ifdef _MSC_VER | ||
#pragma message("WARNING: This header file is deprecated. It will be removed in future eCAL versions. Please include <ecal/app/pb/mma/mma.pb.h> instead") | ||
#endif /*_MSC_VER*/ | ||
#ifdef __GNUC__ | ||
#pragma message "WARNING: This header file is deprecated. It will be removed in future eCAL versions. Please include <ecal/app/pb/mma/mma.pb.h> instead" | ||
#endif /* __GNUC__ */ | ||
package eCAL.pb; | ||
|
||
#include <ecal/app/pb/mma/mma.pb.h> | ||
message LogMessage // eCAL log message | ||
{ | ||
int64 time = 1; // time | ||
string hname = 2; // host name | ||
int32 pid = 3; // process id | ||
string pname = 4; // process name | ||
string uname = 5; // unit name | ||
int32 level = 6; // message level | ||
string content = 7; // message content | ||
} | ||
|
||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. But much nicer :-) |
||
} |
This file was deleted.
This file was deleted.
This file was deleted.
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]