-
Notifications
You must be signed in to change notification settings - Fork 174
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
[config] Adding config object to logging #1704
Conversation
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
attr.broadcast = UDP::IsBroadcast(); | ||
attr.loopback = true; | ||
attr.sndbuf = UDP::GetSendBufferSize(); | ||
eCAL::UDP::SSenderAttr attr = UDP::CreateUDPSenderAttr(GetConfiguration().registration, GetConfiguration().transport_layer.udp); |
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 'attr' of type 'eCAL::UDP::SSenderAttr' can be declared 'const' [misc-const-correctness]
eCAL::UDP::SSenderAttr attr = UDP::CreateUDPSenderAttr(GetConfiguration().registration, GetConfiguration().transport_layer.udp); | |
eCAL::UDP::SSenderAttr const attr = UDP::CreateUDPSenderAttr(GetConfiguration().registration, GetConfiguration().transport_layer.udp); |
attr.broadcast = UDP::IsBroadcast(); | ||
attr.loopback = true; | ||
attr.rcvbuf = UDP::GetReceiveBufferSize(); | ||
eCAL::UDP::SReceiverAttr attr = UDP::CreateUDPReceiverAttr(GetConfiguration().registration, GetConfiguration().transport_layer.udp); |
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 'attr' of type 'eCAL::UDP::SReceiverAttr' can be declared 'const' [misc-const-correctness]
eCAL::UDP::SReceiverAttr attr = UDP::CreateUDPReceiverAttr(GetConfiguration().registration, GetConfiguration().transport_layer.udp); | |
eCAL::UDP::SReceiverAttr const attr = UDP::CreateUDPReceiverAttr(GetConfiguration().registration, GetConfiguration().transport_layer.udp); |
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
const std::string tstring = get_time_str(); | ||
|
||
m_logfile_name = ecal_log_path + tstring + "_" + eCAL::Process::GetUnitName() + "_" + std::to_string(m_pid) + ".log"; | ||
m_logfile = fopen(m_logfile_name.c_str(), "w"); |
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: assigning newly created 'gsl::owner<>' to non-owner 'FILE *' (aka '_IO_FILE *') [cppcoreguidelines-owning-memory]
m_logfile = fopen(m_logfile_name.c_str(), "w");
^
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
There were too many comments to post at once. Showing the first 20 out of 38. Check the log or trigger a new build to see more.
|
||
for (const auto& registration_sample : expired_samples) | ||
{ | ||
Sample unregistration_sample = CreateUnregisterSample(registration_sample.second); |
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 'unregistration_sample' of type 'Sample' can be declared 'const' [misc-const-correctness]
Sample unregistration_sample = CreateUnregisterSample(registration_sample.second); | |
Sample const unregistration_sample = CreateUnregisterSample(registration_sample.second); |
}; | ||
|
||
// Transport layer parameters for ecal udp multicast | ||
struct LayerParUdpMC | ||
{ | ||
bool operator==(const LayerParUdpMC& other) const { |
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: parameter 'other' is unused [misc-unused-parameters]
bool operator==(const LayerParUdpMC& other) const { | |
bool operator==(const LayerParUdpMC& /*other*/) const { |
@@ -40,6 +40,13 @@ namespace | |||
return reg_sample; | |||
} | |||
|
|||
eCAL::Registration::Sample DestroyPublisher(const std::string& topic_name_, std::uint64_t topic_id_) | |||
{ | |||
eCAL::Registration::Sample reg_sample = CreatePublisher(topic_name_, topic_id_); |
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 'reg_sample' is not initialized [cppcoreguidelines-init-variables]
eCAL::Registration::Sample reg_sample = CreatePublisher(topic_name_, topic_id_); | |
eCAL::Registration::Sample reg_sample = 0 = CreatePublisher(topic_name_, topic_id_); |
@@ -52,6 +59,13 @@ | |||
return reg_sample; | |||
} | |||
|
|||
eCAL::Registration::Sample DestroySubscriber(const std::string& topic_name_, std::uint64_t topic_id_) | |||
{ | |||
eCAL::Registration::Sample reg_sample = CreateSubscriber(topic_name_, topic_id_); |
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 'reg_sample' is not initialized [cppcoreguidelines-init-variables]
eCAL::Registration::Sample reg_sample = CreateSubscriber(topic_name_, topic_id_); | |
eCAL::Registration::Sample reg_sample = 0 = CreateSubscriber(topic_name_, topic_id_); |
@@ -65,6 +79,13 @@ | |||
return reg_sample; | |||
} | |||
|
|||
eCAL::Registration::Sample DestroyService(const std::string& service_name_, std::uint64_t service_id_) | |||
{ | |||
eCAL::Registration::Sample reg_sample = CreateService(service_name_, service_id_); |
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 'reg_sample' is not initialized [cppcoreguidelines-init-variables]
eCAL::Registration::Sample reg_sample = CreateService(service_name_, service_id_); | |
eCAL::Registration::Sample reg_sample = 0 = CreateService(service_name_, service_id_); |
|
||
// sample should be expired | ||
EXPECT_EQ(0, desc_gate.GetClients().size()); | ||
} | ||
|
||
TEST(core_cpp_descgate, ManyClient) | ||
{ | ||
eCAL::CDescGate desc_gate(std::chrono::milliseconds(DESCGATE_EXPIRATION_MS)); | ||
eCAL::CDescGate desc_gate; |
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 'desc_gate' is not initialized [cppcoreguidelines-init-variables]
eCAL::CDescGate desc_gate; | |
eCAL::CDescGate desc_gate = 0; |
// sleep | ||
TestingClock::increment_time(std::chrono::milliseconds(150)); | ||
} | ||
|
||
TEST(core_cpp_core, ExpMap_EraseMultiple) |
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: all parameters should be named in a function [readability-named-parameter]
TEST(core_cpp_core, ExpMap_EraseMultiple) | |
TEST(core_cpp_core /*unused*/, ExpMap_EraseMultiple /*unused*/) |
|
||
#include <chrono> | ||
|
||
#include <gtest/gtest.h> |
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: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^
#include "registration/ecal_registration_timeout_provider.h" | ||
#include "serialization/ecal_struct_sample_registration.h" | ||
|
||
eCAL::Registration::Sample pub_foo_process_a_unregister; |
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 'pub_foo_process_a_unregister' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
eCAL::Registration::Sample pub_foo_process_a_unregister;
^
#include "serialization/ecal_struct_sample_registration.h" | ||
|
||
eCAL::Registration::Sample pub_foo_process_a_unregister; | ||
eCAL::Registration::Sample pub_foo_process_a_register_1; |
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 'pub_foo_process_a_register_1' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
eCAL::Registration::Sample pub_foo_process_a_register_1;
^
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
#include <ecal/ecal_log.h> | ||
#include <ecal/ecal_log_level.h> | ||
|
||
#include <gtest/gtest.h> |
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: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^
|
||
eCAL::Logging::Log(log_message); | ||
|
||
std::string filepath; |
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 'filepath' of type 'std::string' (aka 'basic_string') can be declared 'const' [misc-const-correctness]
std::string filepath; | |
std::string const filepath; |
…ogging test adaptions.
Closed because of problems after merged master. Using #1724 instead. |
Description
tbd