Skip to content

Commit

Permalink
WIP config path adaptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peguen committed Dec 19, 2024
1 parent 0df066c commit 4b23137
Show file tree
Hide file tree
Showing 13 changed files with 439 additions and 194 deletions.
6 changes: 3 additions & 3 deletions doc/rst/configuration/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ Loading strategy (Priority)
===========================

The eCAL configuration file is loaded based on the following priorities, whereever it is found first.
If you want a specific eCAL Node to run with another ``ecal.yaml`` than the others, you can set the ``ECAL_DATA`` variable before starting the process, e.g. from a batch or shell skript.
If you want a specific eCAL Node to run with another ``ecal.yaml`` than the others, you can set the ``ECAL_CONFIG`` variable before starting the process, e.g. from a batch or shell skript.
In addition, some eCAL applications support providing a path from the command line option ``--ecal-config-file``.

.. important::
This loading strategy is valid for eCAL 5.10 and up.

- |fa-windows| Windows:

1. ``%ECAL_DATA%/ecal.yaml``
1. ``%ECAL_CONFIG%/ecal.yaml``
2. ``%ProgramData%/ecal/ecal.yaml``

- |fa-ubuntu| Ubuntu:

1. ``$ECAL_DATA/ecal.yaml``
1. ``$ECAL_CONFIG/ecal.yaml``
2. ``/etc/ecal/ecal.yaml`` (from ``CMAKE_INSTALL_SYSCONFDIR``)
3. ``/etc/ecal/ecal.yaml`` (fallback)

Expand Down
1 change: 1 addition & 0 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ set(ecal_config_src
src/config/default_configuration.cpp
src/config/ecal_config.cpp
src/config/ecal_config_initializer.cpp
src/config/ecal_path_processing.cpp
src/config/transport_layer.cpp
src/types/ecal_custom_data_types.cpp
)
Expand Down
11 changes: 3 additions & 8 deletions ecal/core/include/ecal/config/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
#include <vector>
#include <string>

namespace
{
// After switchting to c++17, this can be replaced by an inline constexpr
static const eCAL_Logging_Filter log_filter_default = log_level_info | log_level_warning | log_level_error | log_level_fatal;
}

namespace eCAL
{
Expand Down Expand Up @@ -65,9 +60,9 @@ namespace eCAL

struct Configuration
{
Sink console { true, log_level_error | log_level_fatal}; //!< default: true, log_level_error
Sink file { false, log_level_none }; //!< default: false, log_level_none
Sink udp { true, log_filter_default }; //!< default: true, log_filter_default
Sink console { true, log_level_warning | log_level_error | log_level_fatal }; //!< default: true, log_level_warning | log_level_error | log_level_fatal
Sink file { false, log_level_none }; //!< default: false, log_level_none
Sink udp { true, log_level_info | log_level_warning | log_level_error | log_level_fatal }; //!< default: true, log_level_info | log_level_warning | log_level_error | log_level_fatal

File::Configuration file_config;
UDP::Configuration udp_config;
Expand Down
3 changes: 1 addition & 2 deletions ecal/core/include/ecal/ecal_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ namespace eCAL
{
/**
* @brief Retrieve eCAL configuration path.
* This path is for the global eCAL configuration files
* This path is for the local eCAL configuration files
* like ecal.yaml.
* This path is read only for standard users.
*
* @return eCAL configuration path.
**/
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/config/builder/logging_attribute_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace eCAL
attributes.file_config.path = log_config_.provider.file_config.path;
if (attributes.file_config.path.empty())
{
// check ECAL_DATA
// check ECAL_CONFIG
// Creates path if not exists
attributes.file_config.path = Util::GeteCALLogPath();
}
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/config/ecal_config_initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace eCAL
{
void Configuration::InitFromFile(const std::string& yaml_path_)
{
const std::string yaml_path = eCAL::Path::checkForValidConfigFilePath(yaml_path_);
const std::string yaml_path = eCAL::Config::checkForValidConfigFilePath(yaml_path_);
if (!yaml_path.empty())
{
#ifdef ECAL_CORE_CONFIGURATION
Expand Down
Loading

0 comments on commit 4b23137

Please sign in to comment.