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

[Logging] Introducing Provider/Receiver pattern for logging #1831

Merged
merged 24 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
dbb5478
Changed pubsub logging to use the API instead of globals.
Peguen Dec 2, 2024
9cbaf5a
Split of ecal_log into log provider and receiver.
Peguen Dec 2, 2024
bddd31f
Added missing atomic header.
Peguen Dec 2, 2024
360deb9
Changed typo in includes.
Peguen Dec 2, 2024
28d7734
Introduced logging UDP receive variable.
Peguen Dec 3, 2024
2c2956c
Receive functionality in log_receiver.
Peguen Dec 3, 2024
24a0b13
Adapted logging tests.
Peguen Dec 3, 2024
50f88ca
Removed unused attributes for loggin receiver/provider.
Peguen Dec 4, 2024
294e531
Changed logging structs to be defined within the attribute struct.
Peguen Dec 4, 2024
a5bf465
Changed global accessor handling.
Peguen Dec 4, 2024
c390e4c
Added UDPLogReceive to eCAL::Init.
Peguen Dec 4, 2024
d22b9a9
Added UDPLogReceive to Init::ALL.
Peguen Dec 4, 2024
960e9ba
Added UDPLogReceive to apps.
Peguen Dec 4, 2024
546db2c
Small clangtidy things.
Peguen Dec 4, 2024
4072334
Adapted test for logging.
Peguen Dec 4, 2024
ee26111
Removed failing header.
Peguen Dec 4, 2024
bcf6d54
Fixed wrong type in default yaml configuration.
Peguen Dec 5, 2024
c4f4cd7
Better logic for logging attributes.
Peguen Dec 6, 2024
e0729f6
Changed udp logging config to have an own udp receiving configuration.
Peguen Dec 6, 2024
2d6cee1
Merge branch 'master' into feature/logging_split
Peguen Dec 6, 2024
2b4d197
Changed logging struct and yaml to be consistent with the attributes.
Peguen Dec 6, 2024
2c53961
Merge remote.
Peguen Dec 6, 2024
9ceee76
Merge branch 'master' into feature/logging_split
rex-schilasky Dec 6, 2024
76707d5
Reworked logging structure.
Peguen Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/mon/mon_gui/src/ecalmon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Ecalmon::Ecalmon(QWidget *parent)
, monitor_error_counter_(0)
{
// Just make sure that eCAL is initialized
eCAL::Initialize(0, nullptr, "eCALMon", eCAL::Init::Default | eCAL::Init::Monitoring);
eCAL::Initialize(0, nullptr, "eCALMon", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::Default" is directly included [misc-include-cleaner]

app/mon/mon_gui/src/ecalmon.cpp:24:

- #include "widgets/about_dialog/about_dialog.h"
+ #include "ecal/ecal_init.h"
+ #include "widgets/about_dialog/about_dialog.h"

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::Monitoring" is directly included [misc-include-cleaner]

  eCAL::Initialize(0, nullptr, "eCALMon", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
                                                                            ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::UDPLogReceive" is directly included [misc-include-cleaner]

  eCAL::Initialize(0, nullptr, "eCALMon", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
                                                                                                     ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Initialize" is directly included [misc-include-cleaner]

app/mon/mon_gui/src/ecalmon.cpp:24:

- #include "widgets/about_dialog/about_dialog.h"
+ #include "ecal/ecal_core.h"
+ #include "widgets/about_dialog/about_dialog.h"

eCAL::Monitoring::SetFilterState(false);
eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running");

Expand Down
2 changes: 1 addition & 1 deletion app/mon/mon_tui/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main(int argc, char** argv)
{
auto args = ParseArgs(argc, argv);

auto status = eCAL::Initialize(0, nullptr, "eCALMon TUI", eCAL::Init::Default | eCAL::Init::Monitoring);
auto status = eCAL::Initialize(0, nullptr, "eCALMon TUI", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::Default" is directly included [misc-include-cleaner]

app/mon/mon_tui/src/main.cpp:28:

- #include "tui/tui.hpp"
+ #include "ecal/ecal_init.h"
+ #include "tui/tui.hpp"

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::Monitoring" is directly included [misc-include-cleaner]

  auto status = eCAL::Initialize(0, nullptr, "eCALMon TUI", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
                                                                                              ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::UDPLogReceive" is directly included [misc-include-cleaner]

  auto status = eCAL::Initialize(0, nullptr, "eCALMon TUI", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
                                                                                                                       ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Initialize" is directly included [misc-include-cleaner]

app/mon/mon_tui/src/main.cpp:28:

- #include "tui/tui.hpp"
+ #include "ecal/ecal_core.h"
+ #include "tui/tui.hpp"

if (status == -1) std::cerr << "Failed to init" << std::endl;
eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running");
eCAL::Monitoring::SetFilterState(false);
Expand Down
2 changes: 1 addition & 1 deletion app/rec/rec_client_core/src/ecal_rec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace eCAL

EcalRec::EcalRec()
{
eCAL::Initialize(0, nullptr, "eCALRecClient", eCAL::Init::Default | eCAL::Init::Monitoring);
eCAL::Initialize(0, nullptr, "eCALRecClient", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::Default" is directly included [misc-include-cleaner]

app/rec/rec_client_core/src/ecal_rec.cpp:21:

- #include "ecal_rec_impl.h"
+ #include "ecal/ecal_init.h"
+ #include "ecal_rec_impl.h"

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::Monitoring" is directly included [misc-include-cleaner]

      eCAL::Initialize(0, nullptr, "eCALRecClient", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
                                                                                      ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::UDPLogReceive" is directly included [misc-include-cleaner]

      eCAL::Initialize(0, nullptr, "eCALRecClient", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
                                                                                                               ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Initialize" is directly included [misc-include-cleaner]

app/rec/rec_client_core/src/ecal_rec.cpp:21:

- #include "ecal_rec_impl.h"
+ #include "ecal/ecal_core.h"
+ #include "ecal_rec_impl.h"

eCAL::Monitoring::SetFilterState(false);

recorder_ = std::make_unique<EcalRecImpl>();
Expand Down
2 changes: 1 addition & 1 deletion app/rec/rec_gui/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int main(int argc, char *argv[])
}

// Just make sure that eCAL is initialized
eCAL::Initialize(0, nullptr, "eCALRecGUI", eCAL::Init::Default | eCAL::Init::Service | eCAL::Init::Monitoring);
eCAL::Initialize(0, nullptr, "eCALRecGUI", eCAL::Init::Default | eCAL::Init::Service | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::Default" is directly included [misc-include-cleaner]

app/rec/rec_gui/src/main.cpp:19:

- #include "ecalrec_gui.h"
+ #include "ecal/ecal_init.h"
+ #include "ecalrec_gui.h"

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::Monitoring" is directly included [misc-include-cleaner]

  eCAL::Initialize(0, nullptr, "eCALRecGUI", eCAL::Init::Default | eCAL::Init::Service | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
                                                                                                     ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::Service" is directly included [misc-include-cleaner]

  eCAL::Initialize(0, nullptr, "eCALRecGUI", eCAL::Init::Default | eCAL::Init::Service | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
                                                                               ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::UDPLogReceive" is directly included [misc-include-cleaner]

  eCAL::Initialize(0, nullptr, "eCALRecGUI", eCAL::Init::Default | eCAL::Init::Service | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
                                                                                                                              ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Initialize" is directly included [misc-include-cleaner]

app/rec/rec_gui/src/main.cpp:19:

- #include "ecalrec_gui.h"
+ #include "ecal/ecal_core.h"
+ #include "ecalrec_gui.h"

eCAL::Monitoring::SetFilterState(false);

EcalRecGui* w = new EcalRecGui();
Expand Down
2 changes: 1 addition & 1 deletion app/rec/rec_server_core/src/rec_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace eCAL
settings_.ClearHostFilter(); // There is no global host filter

// Initialize eCAL
eCAL::Initialize(0, nullptr, "eCALRec-Server", eCAL::Init::Default | eCAL::Init::Monitoring);
eCAL::Initialize(0, nullptr, "eCALRec-Server", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::Default" is directly included [misc-include-cleaner]

app/rec/rec_server_core/src/rec_server_impl.cpp:21:

- #include "recorder_settings.h"
+ #include "ecal/ecal_init.h"
+ #include "recorder_settings.h"

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::Monitoring" is directly included [misc-include-cleaner]

      eCAL::Initialize(0, nullptr, "eCALRec-Server", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
                                                                                       ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Init::UDPLogReceive" is directly included [misc-include-cleaner]

      eCAL::Initialize(0, nullptr, "eCALRec-Server", eCAL::Init::Default | eCAL::Init::Monitoring | eCAL::Init::UDPLogReceive);
                                                                                                                ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Initialize" is directly included [misc-include-cleaner]

app/rec/rec_server_core/src/rec_server_impl.cpp:21:

- #include "recorder_settings.h"
+ #include "ecal/ecal_core.h"
+ #include "recorder_settings.h"


// Start FTP Server
ftp_server_->start(5);
Expand Down
4 changes: 2 additions & 2 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ endif()
######################################
set(ecal_logging_src
src/logging/ecal_log.cpp
src/logging/ecal_log_impl.cpp
src/logging/ecal_log_impl.h
src/logging/ecal_log_provider.cpp
src/logging/ecal_log_receiver.cpp
)

######################################
Expand Down
16 changes: 13 additions & 3 deletions ecal/core/include/ecal/config/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,21 @@ namespace eCAL
};
}

namespace UDPReceiver
{
struct Configuration
{
bool enable { false }; //!< Enable UDP receiver (Default: false)
unsigned int port { 14001 }; //!< UDP port number (Default: 14001)
};
}

struct Configuration
{
Console::Configuration console;
File::Configuration file;
UDP::Configuration udp;
Console::Configuration console;
File::Configuration file;
UDP::Configuration udp;
UDPReceiver::Configuration udp_receiver;
};
}

Expand Down
16 changes: 9 additions & 7 deletions ecal/core/include/ecal/ecal_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,21 @@ namespace eCAL
{
namespace Init
{
static const unsigned int Publisher = 0x001;
static const unsigned int Subscriber = 0x002;
static const unsigned int Service = 0x004;
static const unsigned int Monitoring = 0x008;
static const unsigned int Logging = 0x010;
static const unsigned int TimeSync = 0x020;
static const unsigned int Publisher = 0x001;
static const unsigned int Subscriber = 0x002;
static const unsigned int Service = 0x004;
static const unsigned int Monitoring = 0x008;
static const unsigned int Logging = 0x010;
static const unsigned int TimeSync = 0x020;
Copy link
Contributor

Choose a reason for hiding this comment

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

you could realign, so you don't get any changes in this file

static const unsigned int UDPLogReceive = 0x040;

static const unsigned int All = Publisher
| Subscriber
| Service
| Monitoring
| Logging
| TimeSync;
| TimeSync
| UDPLogReceive;

static const unsigned int Default = Publisher
| Subscriber
Expand Down
54 changes: 32 additions & 22 deletions ecal/core/src/config/builder/logging_attribute_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,70 @@ namespace eCAL
{
namespace Logging
{
SAttributes BuildLoggingAttributes(const Logging::Configuration& log_config_, const Registration::Configuration& reg_config_, const TransportLayer::Configuration& tl_config_)
SProviderAttributes BuildLoggingProviderAttributes(const Logging::Configuration& log_config_, const Registration::Configuration& reg_config_, const TransportLayer::Configuration& tl_config_)
Peguen marked this conversation as resolved.
Show resolved Hide resolved
Peguen marked this conversation as resolved.
Show resolved Hide resolved
Peguen marked this conversation as resolved.
Show resolved Hide resolved
Peguen marked this conversation as resolved.
Show resolved Hide resolved
{
SAttributes attributes;
SProviderAttributes attributes;

attributes.network_enabled = reg_config_.network_enabled;
Peguen marked this conversation as resolved.
Show resolved Hide resolved
attributes.host_name = Process::GetHostName();
attributes.process_id = Process::GetProcessID();
attributes.process_name = Process::GetProcessName();
attributes.unit_name = Process::GetUnitName();
attributes.level = log_level_info;

attributes.udp.enabled = log_config_.sinks.udp.enable;
attributes.udp.port = log_config_.sinks.udp.port;
attributes.udp.filter_log = log_config_.sinks.udp.filter_log_udp;
attributes.udp_sink.enabled = log_config_.sinks.udp.enable;
attributes.udp_sink.filter_log = log_config_.sinks.udp.filter_log_udp;

attributes.file.enabled = log_config_.sinks.file.enable;
attributes.file.filter_log = log_config_.sinks.file.filter_log_file;
attributes.file.path = log_config_.sinks.file.path;
if (attributes.file.path.empty())
attributes.file_sink.enabled = log_config_.sinks.file.enable;
attributes.file_sink.filter_log = log_config_.sinks.file.filter_log_file;
attributes.file_config.path = log_config_.sinks.file.path;
if (attributes.file_config.path.empty())
{
// check ECAL_DATA
// Creates path if not exists
attributes.file.path = Util::GeteCALLogPath();
attributes.file_config.path = Util::GeteCALLogPath();
}

attributes.console.enabled = log_config_.sinks.console.enable;
attributes.console.filter_log = log_config_.sinks.console.filter_log_con;
attributes.console_sink.enabled = log_config_.sinks.console.enable;
attributes.console_sink.filter_log = log_config_.sinks.console.filter_log_con;

// UDP related configuration part
attributes.udp_sender.broadcast = !reg_config_.network_enabled;
attributes.udp_sender.loopback = reg_config_.loopback;
attributes.udp_config.broadcast = !reg_config_.network_enabled;
attributes.udp_config.loopback = reg_config_.loopback;

attributes.udp_sender.sndbuf = tl_config_.udp.send_buffer;
attributes.udp_sender.port = tl_config_.udp.port;
attributes.udp_config.sndbuf = tl_config_.udp.send_buffer;
attributes.udp_config.port = log_config_.sinks.udp.port;

switch (tl_config_.udp.mode)
{
case Types::UDPMode::NETWORK:
attributes.udp_sender.address = tl_config_.udp.network.group;
attributes.udp_sender.ttl = tl_config_.udp.network.ttl;
attributes.udp_config.address = tl_config_.udp.network.group;
attributes.udp_config.ttl = tl_config_.udp.network.ttl;
break;
case Types::UDPMode::LOCAL:
attributes.udp_sender.address = tl_config_.udp.local.group;
attributes.udp_sender.ttl = tl_config_.udp.local.ttl;
attributes.udp_config.address = tl_config_.udp.local.group;
attributes.udp_config.ttl = tl_config_.udp.local.ttl;
break;
default:
break;
}

return attributes;
}

SReceiverAttributes BuildLoggingReceiverAttributes(const Logging::Configuration& log_config_, const Registration::Configuration& reg_config_, const TransportLayer::Configuration& tl_config_)
Peguen marked this conversation as resolved.
Show resolved Hide resolved
{
SReceiverAttributes attributes;

attributes.network_enabled = reg_config_.network_enabled;
attributes.host_name = Process::GetHostName();

attributes.receive_enabled = log_config_.sinks.udp_receiver.enable;

attributes.udp_receiver.broadcast = !reg_config_.network_enabled;
attributes.udp_receiver.loopback = true;

attributes.udp_receiver.rcvbuf = tl_config_.udp.receive_buffer;
attributes.udp_receiver.port = tl_config_.udp.port;
attributes.udp_receiver.port = log_config_.sinks.udp_receiver.port;

switch (tl_config_.udp.mode)
{
Expand Down
6 changes: 4 additions & 2 deletions ecal/core/src/config/builder/logging_attribute_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

#pragma once

#include "logging/config/attributes/logging_attributes.h"
#include "logging/config/attributes/ecal_log_provider_attributes.h"
#include "logging/config/attributes/ecal_log_receiver_attributes.h"
#include "ecal/config/logging.h"
#include "ecal/config/registration.h"
#include "ecal/config/transport_layer.h"
Expand All @@ -28,6 +29,7 @@ namespace eCAL
{
namespace Logging
{
SAttributes BuildLoggingAttributes(const Logging::Configuration& log_config_, const Registration::Configuration& reg_config_, const TransportLayer::Configuration& tl_config_);
SProviderAttributes BuildLoggingProviderAttributes(const Logging::Configuration& log_config_, const Registration::Configuration& reg_config_, const TransportLayer::Configuration& tl_config_);
SReceiverAttributes BuildLoggingReceiverAttributes(const Logging::Configuration& log_config_, const Registration::Configuration& reg_config_, const TransportLayer::Configuration& tl_config_);
}
}
16 changes: 16 additions & 0 deletions ecal/core/src/config/configuration_to_yaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,22 @@ namespace YAML
/____/\___/\_, /\_, /_/_//_/\_, /
/___//___/ /___/
*/

Node convert<eCAL::Logging::Sinks::UDPReceiver::Configuration>::encode(const eCAL::Logging::Sinks::UDPReceiver::Configuration& config_)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Logging::Sinks::UDPReceiver::Configuration" is directly included [misc-include-cleaner]

ecal/core/src/config/configuration_to_yaml.cpp:1:

+ #include "ecal/config/logging.h"

{
Node node;
node["enable"] = config_.enable;
node["port"] = config_.port;
return node;
}

bool convert<eCAL::Logging::Sinks::UDPReceiver::Configuration>::decode(const Node& node_, eCAL::Logging::Sinks::UDPReceiver::Configuration& config_)
{
AssignValue<bool>(config_.enable, node_, "enable");
AssignValue<unsigned int>(config_.port, node_, "port");

return true;
}

Node convert<eCAL::Logging::Sinks::UDP::Configuration>::encode(const eCAL::Logging::Sinks::UDP::Configuration& config_)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Logging::Sinks::UDP::Configuration" is directly included [misc-include-cleaner]

  Node convert<eCAL::Logging::Sinks::UDP::Configuration>::encode(const eCAL::Logging::Sinks::UDP::Configuration& config_)
                                          ^

{
Expand Down
8 changes: 8 additions & 0 deletions ecal/core/src/config/configuration_to_yaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,14 @@ namespace YAML
/____/\___/\_, /\_, /_/_//_/\_, /
/___//___/ /___/
*/
template<>
struct convert<eCAL::Logging::Sinks::UDPReceiver::Configuration>
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "eCAL::Logging::Sinks::UDPReceiver::Configuration" is directly included [misc-include-cleaner]

ecal/core/src/config/configuration_to_yaml.h:26:

- #include <ecal/config/configuration.h>
+ #include "ecal/config/logging.h"
+ #include <ecal/config/configuration.h>

{
static Node encode(const eCAL::Logging::Sinks::UDPReceiver::Configuration& config_);

static bool decode(const Node& node_, eCAL::Logging::Sinks::UDPReceiver::Configuration& config_);
};

template<>
struct convert<eCAL::Logging::Sinks::UDP::Configuration>
{
Expand Down
9 changes: 7 additions & 2 deletions ecal/core/src/config/default_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,14 @@ namespace eCAL
ss << R"( # Enable UDP logging)" << "\n";
ss << R"( enable: )" << config_.logging.sinks.udp.enable << "\n";
ss << R"( # Log level for UDP output)" << "\n";
ss << R"( level: )" << logToArray(config_.logging.sinks.udp.filter_log_udp) << "\n";
ss << R"( # UDP)" << "\n";
ss << R"( level: )" << logToArray(config_.logging.sinks.udp.filter_log_udp) << "\n";
ss << R"( # UDP Port)" << "\n";
ss << R"( port: )" << config_.logging.sinks.udp.port << "\n";
ss << R"( udp_receiver:)" << "\n";
ss << R"( # Enable UDP log receiving)" << "\n";
ss << R"( enable: )" << config_.logging.sinks.udp_receiver.enable << "\n";
ss << R"( # UDP Port)" << "\n";
ss << R"( port: )" << config_.logging.sinks.udp_receiver.port << "\n";
ss << R"()" << "\n";

return ss;
Expand Down
10 changes: 8 additions & 2 deletions ecal/core/src/ecal_global_accessors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,16 @@ namespace eCAL
return g_globals_ctx;
}

CLog* g_log()
Logging::CLogReceiver* g_log_udp_receiver()
{
if (g_globals() == nullptr) return(nullptr);
return(g_globals()->log().get());
return(g_globals()->log_udp_receiver().get());
}

Logging::CLogProvider* g_log_provider()
{
if (g_globals() == nullptr) return(nullptr);
return(g_globals()->log_provider().get());
}

Configuration& g_ecal_config()
Expand Down
10 changes: 8 additions & 2 deletions ecal/core/src/ecal_global_accessors.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@
namespace eCAL
{
class CGlobals;
class CLog;
struct Configuration;

namespace Logging
{
class CLogProvider;
class CLogReceiver;
}

#if ECAL_CORE_MONITORING
class CMonitoring;
#endif
Expand Down Expand Up @@ -66,7 +71,8 @@ namespace eCAL

// Declaration of getter functions for globally accessible variable instances
CGlobals* g_globals();
CLog* g_log();
Logging::CLogReceiver* g_log_udp_receiver();
Logging::CLogProvider* g_log_provider();
#if ECAL_CORE_MONITORING
CMonitoring* g_monitoring();
#endif
Expand Down
Loading
Loading