From 2540925eb21bc621f910787fcb71627ca072b5f8 Mon Sep 17 00:00:00 2001 From: arsibo Date: Mon, 2 Feb 2026 07:37:37 +0000 Subject: [PATCH 1/5] docs: Add architecture documentation for logging feature and components POC for https://github.com/eclipse-score/score/pull/2346 Add comprehensive architecture documentation with focus on architecture modeling: - Logging feature (mw-fr_logging) with feature architecture - Component architectures for: - data_router_recorder - datarouter - file_recorder - log_bridge - recorders Note: Documentation templates are not yet completely filled out. Further refinement and completion of templates is required in future iterations. --- BUILD | 6 +- MODULE.bazel | 32 +- docs/conf.py | 2 +- .../docs/architecture/index.rst | 146 ++++++ docs/data_router_recorder/docs/index.rst | 173 +++++++ docs/datarouter/docs/architecture/index.rst | 155 ++++++ docs/datarouter/docs/index.rst | 173 +++++++ .../feat_arc_sta__log__logging.drawio.svg | 401 ++++++++++++++ .../logging/docs/architecture/.gitkeep | 0 .../logging/docs/architecture/index.rst | 141 +++++ docs/features/logging/docs/glossary.rst | 47 ++ .../logging/docs/requirements/.gitkeep | 0 .../docs/requirements/mw-fr_logging_req.rst | 490 ++++++++++++++++++ .../logging/docs/safety_analysis/.gitkeep | 0 .../logging/docs/safety_planning/.gitkeep | 0 .../logging/docs/verification/.gitkeep | 0 docs/features/logging/index.rst | 24 + docs/features/logging/mw-fr_logging.rst | 210 ++++++++ .../logging/mw-fr_logging_DD_Input.rst_tmp | 44 ++ .../logging/tests/integration-tests/.gitkeep | 0 .../file_recorder/docs/architecture/index.rst | 146 ++++++ docs/file_recorder/docs/index.rst | 173 +++++++ docs/index.rst | 44 ++ docs/log_bridge/docs/architecture/index.rst | 147 ++++++ docs/log_bridge/docs/index.rst | 173 +++++++ docs/recorders/docs/architecture/index.rst | 146 ++++++ docs/recorders/docs/index.rst | 173 +++++++ .../test/ut/ut_logging/test_logparser.cpp | 2 +- score/mw/log/rust/score_log_bridge/BUILD | 10 - .../rust/score_log_bridge/examples/main.rs | 8 +- .../log/rust/score_log_bridge/src/adapter.cpp | 2 +- score/mw/log/rust/score_log_bridge/src/ffi.rs | 5 +- score/mw/log/rust/score_log_bridge/src/lib.rs | 4 +- .../{score_log_bridge.rs => score_logger.rs} | 46 +- .../log/rust/score_log_bridge_cpp_init/BUILD | 67 --- .../examples/example_lib.rs | 75 --- .../examples/main.cpp | 30 -- .../log/rust/score_log_bridge_cpp_init/ffi.rs | 50 -- .../score_log_bridge_init.cpp | 67 --- .../score_log_bridge_init.h | 65 --- 40 files changed, 3065 insertions(+), 412 deletions(-) create mode 100644 docs/data_router_recorder/docs/architecture/index.rst create mode 100644 docs/data_router_recorder/docs/index.rst create mode 100644 docs/datarouter/docs/architecture/index.rst create mode 100644 docs/datarouter/docs/index.rst create mode 100644 docs/features/logging/_assets/feat_arc_sta__log__logging.drawio.svg create mode 100644 docs/features/logging/docs/architecture/.gitkeep create mode 100644 docs/features/logging/docs/architecture/index.rst create mode 100644 docs/features/logging/docs/glossary.rst create mode 100644 docs/features/logging/docs/requirements/.gitkeep create mode 100644 docs/features/logging/docs/requirements/mw-fr_logging_req.rst create mode 100644 docs/features/logging/docs/safety_analysis/.gitkeep create mode 100644 docs/features/logging/docs/safety_planning/.gitkeep create mode 100644 docs/features/logging/docs/verification/.gitkeep create mode 100644 docs/features/logging/index.rst create mode 100644 docs/features/logging/mw-fr_logging.rst create mode 100644 docs/features/logging/mw-fr_logging_DD_Input.rst_tmp create mode 100644 docs/features/logging/tests/integration-tests/.gitkeep create mode 100644 docs/file_recorder/docs/architecture/index.rst create mode 100644 docs/file_recorder/docs/index.rst create mode 100644 docs/log_bridge/docs/architecture/index.rst create mode 100644 docs/log_bridge/docs/index.rst create mode 100644 docs/recorders/docs/architecture/index.rst create mode 100644 docs/recorders/docs/index.rst rename score/mw/log/rust/score_log_bridge/src/{score_log_bridge.rs => score_logger.rs} (89%) delete mode 100644 score/mw/log/rust/score_log_bridge_cpp_init/BUILD delete mode 100644 score/mw/log/rust/score_log_bridge_cpp_init/examples/example_lib.rs delete mode 100644 score/mw/log/rust/score_log_bridge_cpp_init/examples/main.cpp delete mode 100644 score/mw/log/rust/score_log_bridge_cpp_init/ffi.rs delete mode 100644 score/mw/log/rust/score_log_bridge_cpp_init/score_log_bridge_init.cpp delete mode 100644 score/mw/log/rust/score_log_bridge_cpp_init/score_log_bridge_init.h diff --git a/BUILD b/BUILD index c214ee9..523ec8e 100644 --- a/BUILD +++ b/BUILD @@ -47,8 +47,10 @@ exports_files([ # - `:docs` for building documentation at build-time docs( data = [ - # "@score_platform//:needs_json", - # "@score_process//:needs_json", + "@score_platform//:needs_json", + "@score_baselibs//:needs_json", + "@score_baselibs_rust//:needs_json", + "@score_process//:needs_json", ], source_dir = "docs", ) diff --git a/MODULE.bazel b/MODULE.bazel index cfd7162..4d571af 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -28,11 +28,19 @@ bazel_dep(name = "platforms", version = "1.0.0") # S-CORE process rules bazel_dep(name = "score_bazel_platforms", version = "0.0.3") bazel_dep(name = "score_docs_as_code", version = "2.2.0") +local_path_override( + module_name = "score_docs_as_code", + path = "/workspaces/arsibo_dr_005_poc_20260130/score_docs-as-code", +) bazel_dep(name = "score_tooling", version = "1.0.4") bazel_dep(name = "score_rust_policies", version = "0.0.3") bazel_dep(name = "score_process", version = "1.4.0", dev_dependency = True) bazel_dep(name = "score_platform", version = "0.5.1", dev_dependency = True) +local_path_override( + module_name = "score_platform", + path = "/workspaces/arsibo_dr_005_poc_20260130/score_score", +) # Toolchains and extensions bazel_dep(name = "score_toolchains_gcc", version = "0.5", dev_dependency = True) @@ -43,9 +51,10 @@ bazel_dep(name = "score_toolchains_rust", version = "0.4.0", dev_dependency = Tr bazel_dep(name = "score_crates", version = "0.0.6") # Overrides +# update to same version as baselib git_override( module_name = "score_tooling", - commit = "612d6f180a9bb6338de5f0e6667fcf83068d9c37", #until 1.0.5 is released + commit = "8894fe5440436a8c6d9e214c97b18d619c7f7eac", remote = "https://github.com/eclipse-score/tooling.git", ) @@ -92,20 +101,23 @@ use_repo(toolchains_qnx, "toolchains_qnx_ifs") bazel_dep(name = "googletest", version = "1.17.0.bcr.1") bazel_dep(name = "rapidjson", version = "1.1.0") -bazel_dep(name = "score_communication", version = "0.1.2") -git_override( - module_name = "score_communication", - commit = "5a70133dd8bd632f5c07f200a5ee4bc9f507c23b", - remote = "https://github.com/eclipse-score/communication.git", -) +# bazel_dep(name = "score_communication", version = "0.1.2") +# git_override( +# module_name = "score_communication", +# commit = "5a70133dd8bd632f5c07f200a5ee4bc9f507c23b", +# remote = "https://github.com/eclipse-score/communication.git", +# ) bazel_dep(name = "score_baselibs", version = "0.2.0") -git_override( +local_path_override( module_name = "score_baselibs", - commit = "3c65b223e9f516f95935bb4cd2e83d6088ca016f", - remote = "https://github.com/eclipse-score/baselibs.git", + path = "/workspaces/arsibo_dr_005_poc_20260130/score_baselibs", ) # Rust dependencies bazel_dep(name = "score_baselibs_rust", version = "0.0.3") +local_path_override( + module_name = "score_baselibs_rust", + path = "/workspaces/arsibo_dr_005_poc_20260130/score_baselibs_rust", +) diff --git a/docs/conf.py b/docs/conf.py index 64d78f2..cf13475 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,7 +34,7 @@ "sphinx_design", "sphinx_needs", "sphinxcontrib.plantuml", - # "score_plantuml", + "score_plantuml", "score_metamodel", "score_draw_uml_funcs", "score_source_code_linker", diff --git a/docs/data_router_recorder/docs/architecture/index.rst b/docs/data_router_recorder/docs/architecture/index.rst new file mode 100644 index 0000000..f08f655 --- /dev/null +++ b/docs/data_router_recorder/docs/architecture/index.rst @@ -0,0 +1,146 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_architecture_data_router_recorder: + +data_router_recorder Component Architecture +=========================================== + +.. document:: data_router_recorder Architecture + :id: doc__data_router_recorder_architecture + :status: draft + :safety: ASIL_B + :security: NO + :realizes: wp__component_arch + :tags: template + +.. attention:: + The above directive must be updated according to your needs. + + - Modify ``Your Component Name`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` and followed by ``_architecture`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Overview +-------- + + +Requirements Linked to Component Architecture +--------------------------------------------- + +.. code-block:: none + + .. needtable:: Overview of Component Requirements + :style: table + :columns: title;id + :filter: search("comp_arch_sta__archdes$", "fulfils_back") + :colwidths: 70,30 + +Description +----------- + + + + + + + +Rationale Behind Architecture Decomposition +******************************************* + +Mandatory: A motivation for the decomposition or reason for not further splitting it into internal components. + +.. note:: Common decisions across components / cross cutting concepts is at the higher level. + +Static Architecture +------------------- + +The components are designed to cover the expectations from the feature architecture +(i.e. if already exists a definition it should be taken over and enriched). + +.. comp:: data_router_recorder + :id: comp__data_router_recorder + :security: YES + :safety: ASIL_B + :status: invalid + :implements: logic_arc_int__log_cpp__recorder, logic_arc_int__logging__buffer, + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_component(need(), needs) }} +.. + TEMPLATE: Uncomment and fill out the following comp_arc_sta directive: + + .. comp_arc_sta:: Component Name (Static View) + :id: comp_arc_sta__component_name__static_view + :security: YES + :safety: ASIL_B + :status: invalid + :implements: logic_arc_int__feature_name__interface_name1 + :fulfils: comp_req__component_name__some_title + :includes: comp_arc_sta__component_name__2 + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_component(need(), needs) }} + +Dynamic Architecture +-------------------- + +.. + TEMPLATE: Uncomment and customize the comp_arc_dyn directive: + + .. comp_arc_dyn:: Dynamic View + :id: comp_arc_dyn__component_name__dynamic_view + :security: YES + :safety: ASIL_B + :status: invalid + :fulfils: comp_req__component_name__some_title + + Put here a sequence diagram + + +Interfaces +---------- + + +Internal Components +------------------- + +.. + TEMPLATE: Uncomment and customize the comp_arc_sta directive: + + .. comp_arc_sta:: Component Name Static View + :id: comp_arc_sta__component_name__2 + :status: invalid + :safety: ASIL_B + :security: YES + :fulfils: comp_req__component_name__some_title + :implements: logic_arc_int__feature_name__interface_name1 + + No architecture but detailed design + +.. note:: + Architecture can be split into multiple files. At component level the public interfaces to be used by the user and tester to be shown. + +.. attention:: + The above directives must be updated according to your component architecture. + + - Replace the example content by the real content (according to :need:`gd_guidl__arch_design`) + - Set the status to valid and start the review/merge process diff --git a/docs/data_router_recorder/docs/index.rst b/docs/data_router_recorder/docs/index.rst new file mode 100644 index 0000000..80689c4 --- /dev/null +++ b/docs/data_router_recorder/docs/index.rst @@ -0,0 +1,173 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_data_router_recorder: + +data_router_recorder +##################### + +.. note:: Document header + +.. document:: data_router_recorder + :id: doc__data_router_recorder + :status: draft + :safety: ASIL_B + :security: NO + :realizes: wp__cmpt_request + :tags: template + +.. attention:: + The above directive must be updated according to your Component. + + - Modify ``document`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Abstract +======== + +[A short (~200 word) description of the contribution being addressed.] + + +Motivation +========== + +[Clearly explain why the existing platform/project solution is inadequate to address the topic that the CR solves.] + +.. note:: + The motivation is critical for CRs that want to change the existing components. + It should clearly explain why the existing solution is inadequate to address the topic that the CR solves. + Motivation may based on criteria as resource requirements, scheduling issues, risks, benefits, etc. + CRs submissions without sufficient motivation may be rejected. + + + +Rationale +========= + +[Describe why particular design decisions were made.] + +.. note:: + The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion. + For the documentation of the decision the :need:`gd_temp__change_decision_record` can be used. + +Specification +============= + +[Describe the requirements, architecture of any new component.] or +[Describe the change to requirements, architecture, implementation, documentation of any change request.] + +.. note:: + A CR shall specify the component requirements as part of our platform/project. + Thereby the :need:`rl__project_lead` will approve these requirements as part of accepting the CR (e.g. merging the PR with the CR). + + +Backwards Compatibility +======================= + +[Describe potential impact (especially including safety and security impacts) and severity on pre-existing platform/project elements.] + + +Security Impact +=============== + +[How could a malicious user take advantage of this new/modified component?] + +.. note:: + If there are security concerns in relation to the CR, those concerns should be explicitly written out to make sure reviewers of the CR are aware of them. + +Which security requirements are affected or has to be changed? +Could the new/modified component enable new threat scenarios? +Could the new/modified component enable new attack paths? +Could the new/modified component impact functional safety? +If applicable, which additional security measures must be implemented to mitigate the risk? + +.. note:: + Use Security Software Critically Analysis, Vulnerability Analysis. + [Methods will be defined later in Process area Security Analysis] + + +Safety Impact +============= + +[How could the safety be impacted by the new/modified component?] + +.. note:: + If there are safety concerns in relation to the CR, those concerns should be explicitly written out to make sure reviewers of the CR are aware of them. + +Which safety requirements are affected or has to be changed? +Could the new/modified component be a potential common cause or cascading failure initiator? +If applicable, which additional safety measures must be implemented to mitigate the risk? + +.. note:: + Use Dependency Failure Analysis and/or Safety Software Critically Analysis. + [Methods will be defined later in Process area Safety Analysis] + +For new feature/component contributions: + +[What is the expected ASIL level?] +[What is the expected classification of the contribution?] + +.. note:: + Use the component classification method here to classify your component, if it shall to be used in a safety context: :need:`gd_temp__component_classification`. + +License Impact +============== + +[How could the copyright impacted by the license of the new contribution?] + + +How to Teach This +================= + +[How to teach users, new and experienced, how to apply the CR to their work.] + +.. note:: + For a CR that adds new functionality or changes behavior, it is helpful to include a section on how to teach users, new and experienced, how to apply the CR to their work. + +Rejected Ideas +============== + +[Why certain ideas that were brought while discussing this CR were not ultimately pursued.] + +.. note:: + Throughout the discussion of a CR, various ideas will be proposed which are not accepted. + Those rejected ideas should be recorded along with the reasoning as to why they were rejected. + This both helps record the thought process behind the final version of the CR as well as preventing people from bringing up the same rejected idea again in subsequent discussions. + In a way this section can be thought of as a breakout section of the Rationale section that is focused specifically on why certain ideas were not ultimately pursued. + + + +Open Issues +=========== + +[Any points that are still being decided/discussed.] + +.. note:: + While a CR is in draft, ideas can come up which warrant further discussion. + Those ideas should be recorded so people know that they are being thought about but do not have a concrete resolution. + This helps make sure all issues required for the CR to be ready for consideration are complete and reduces people duplicating prior discussion. + + + +Footnotes +========= + +[A collection of footnotes cited in the CR, and a place to list non-inline hyperlink targets.] + +.. toctree:: + :hidden: + + architecture/index.rst diff --git a/docs/datarouter/docs/architecture/index.rst b/docs/datarouter/docs/architecture/index.rst new file mode 100644 index 0000000..d25fe33 --- /dev/null +++ b/docs/datarouter/docs/architecture/index.rst @@ -0,0 +1,155 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_architecture_datarouter: + +Datarouter Component Architecture +================================= + +.. + TEMPLATE: Uncomment and customize the document directive: + + .. document:: [Your Component Name] Architecture + :id: doc__component_name_architecture + :status: draft + :safety: ASIL_B + :security: NO + :realizes: wp__component_arch + :tags: template + +.. attention:: + The above directive must be updated according to your needs. + + - Modify ``Your Component Name`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` and followed by ``_architecture`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Overview +-------- + + +Requirements Linked to Component Architecture +--------------------------------------------- + +.. code-block:: none + + .. needtable:: Overview of Component Requirements + :style: table + :columns: title;id + :filter: search("comp_arch_sta__archdes$", "fulfils_back") + :colwidths: 70,30 + +Description +----------- + + + + + + + +Rationale Behind Architecture Decomposition +******************************************* + +Mandatory: A motivation for the decomposition or reason for not further splitting it into internal components. + +.. note:: Common decisions across components / cross cutting concepts is at the higher level. + +Static Architecture +------------------- + +The components are designed to cover the expectations from the feature architecture +(i.e. if already exists a definition it should be taken over and enriched). + +.. comp:: datarouter + :id: comp__datarouter + :security: YES + :safety: ASIL_B + :status: invalid + :uses: logic_arc_int__logging__buffer + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_component(need(), needs) }} +.. + TEMPLATE: Uncomment and fill out the following comp_arc_sta directive: + + .. comp_arc_sta:: Component Name (Static View) + :id: comp_arc_sta__component_name__static_view + :security: YES + :safety: ASIL_B + :status: invalid + :implements: logic_arc_int__feature_name__interface_name1 + :fulfils: comp_req__component_name__some_title + :includes: comp_arc_sta__component_name__2 + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_component(need(), needs) }} + +Dynamic Architecture +-------------------- + +.. + TEMPLATE: Uncomment and customize the comp_arc_dyn directive: + + .. comp_arc_dyn:: Dynamic View + :id: comp_arc_dyn__component_name__dynamic_view + :security: YES + :safety: ASIL_B + :status: invalid + :fulfils: comp_req__component_name__some_title + + Put here a sequence diagram + + +Interfaces +---------- +.. + .. real_arc_int:: + :id: real_arc_int__<component>__<Title> + :security: <YES|NO> + :safety: <QM|ASIL_B> + :fulfils: <link to component requirement id> + :language: cpp + +Internal Components +------------------- + +.. + TEMPLATE: Uncomment and customize the comp_arc_sta directive: + + .. comp_arc_sta:: Component Name Static View + :id: comp_arc_sta__component_name__2 + :status: invalid + :safety: ASIL_B + :security: YES + :fulfils: comp_req__component_name__some_title + :implements: logic_arc_int__feature_name__interface_name1 + + No architecture but detailed design + +.. note:: + Architecture can be split into multiple files. At component level the public interfaces to be used by the user and tester to be shown. + +.. attention:: + The above directives must be updated according to your component architecture. + + - Replace the example content by the real content (according to :need:`gd_guidl__arch_design`) + - Set the status to valid and start the review/merge process diff --git a/docs/datarouter/docs/index.rst b/docs/datarouter/docs/index.rst new file mode 100644 index 0000000..36ac198 --- /dev/null +++ b/docs/datarouter/docs/index.rst @@ -0,0 +1,173 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_datarouter: + +datarouter +########## + +.. note:: Document header + +.. document:: datarouter + :id: doc__datarouter + :status: draft + :safety: ASIL_B + :security: NO + :realizes: wp__cmpt_request + :tags: template + +.. attention:: + The above directive must be updated according to your Component. + + - Modify ``document`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Abstract +======== + +[A short (~200 word) description of the contribution being addressed.] + + +Motivation +========== + +[Clearly explain why the existing platform/project solution is inadequate to address the topic that the CR solves.] + +.. note:: + The motivation is critical for CRs that want to change the existing components. + It should clearly explain why the existing solution is inadequate to address the topic that the CR solves. + Motivation may based on criteria as resource requirements, scheduling issues, risks, benefits, etc. + CRs submissions without sufficient motivation may be rejected. + + + +Rationale +========= + +[Describe why particular design decisions were made.] + +.. note:: + The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion. + For the documentation of the decision the :need:`gd_temp__change_decision_record` can be used. + +Specification +============= + +[Describe the requirements, architecture of any new component.] or +[Describe the change to requirements, architecture, implementation, documentation of any change request.] + +.. note:: + A CR shall specify the component requirements as part of our platform/project. + Thereby the :need:`rl__project_lead` will approve these requirements as part of accepting the CR (e.g. merging the PR with the CR). + + +Backwards Compatibility +======================= + +[Describe potential impact (especially including safety and security impacts) and severity on pre-existing platform/project elements.] + + +Security Impact +=============== + +[How could a malicious user take advantage of this new/modified component?] + +.. note:: + If there are security concerns in relation to the CR, those concerns should be explicitly written out to make sure reviewers of the CR are aware of them. + +Which security requirements are affected or has to be changed? +Could the new/modified component enable new threat scenarios? +Could the new/modified component enable new attack paths? +Could the new/modified component impact functional safety? +If applicable, which additional security measures must be implemented to mitigate the risk? + +.. note:: + Use Security Software Critically Analysis, Vulnerability Analysis. + [Methods will be defined later in Process area Security Analysis] + + +Safety Impact +============= + +[How could the safety be impacted by the new/modified component?] + +.. note:: + If there are safety concerns in relation to the CR, those concerns should be explicitly written out to make sure reviewers of the CR are aware of them. + +Which safety requirements are affected or has to be changed? +Could the new/modified component be a potential common cause or cascading failure initiator? +If applicable, which additional safety measures must be implemented to mitigate the risk? + +.. note:: + Use Dependency Failure Analysis and/or Safety Software Critically Analysis. + [Methods will be defined later in Process area Safety Analysis] + +For new feature/component contributions: + +[What is the expected ASIL level?] +[What is the expected classification of the contribution?] + +.. note:: + Use the component classification method here to classify your component, if it shall to be used in a safety context: :need:`gd_temp__component_classification`. + +License Impact +============== + +[How could the copyright impacted by the license of the new contribution?] + + +How to Teach This +================= + +[How to teach users, new and experienced, how to apply the CR to their work.] + +.. note:: + For a CR that adds new functionality or changes behavior, it is helpful to include a section on how to teach users, new and experienced, how to apply the CR to their work. + +Rejected Ideas +============== + +[Why certain ideas that were brought while discussing this CR were not ultimately pursued.] + +.. note:: + Throughout the discussion of a CR, various ideas will be proposed which are not accepted. + Those rejected ideas should be recorded along with the reasoning as to why they were rejected. + This both helps record the thought process behind the final version of the CR as well as preventing people from bringing up the same rejected idea again in subsequent discussions. + In a way this section can be thought of as a breakout section of the Rationale section that is focused specifically on why certain ideas were not ultimately pursued. + + + +Open Issues +=========== + +[Any points that are still being decided/discussed.] + +.. note:: + While a CR is in draft, ideas can come up which warrant further discussion. + Those ideas should be recorded so people know that they are being thought about but do not have a concrete resolution. + This helps make sure all issues required for the CR to be ready for consideration are complete and reduces people duplicating prior discussion. + + + +Footnotes +========= + +[A collection of footnotes cited in the CR, and a place to list non-inline hyperlink targets.] + +.. toctree:: + :hidden: + + architecture/index.rst diff --git a/docs/features/logging/_assets/feat_arc_sta__log__logging.drawio.svg b/docs/features/logging/_assets/feat_arc_sta__log__logging.drawio.svg new file mode 100644 index 0000000..12c2e5f --- /dev/null +++ b/docs/features/logging/_assets/feat_arc_sta__log__logging.drawio.svg @@ -0,0 +1,401 @@ +<svg host="65bd71144e" xmlns="http://www.w3.org/2000/svg" style="background: transparent; background-color: transparent;" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1047px" height="981px" viewBox="-0.5 -0.5 1047 981" content="<mxfile><diagram name="fr_logging_arc" id="77RRp7X6flVREGI4Bk10">1Vpbc6M2FP41ntk+xGMQF/PoxMl22203O06mTV92BMigBCNXyLGdX78SCAOWfNn4gvNk6ehIoE/fuQl3wM1k8ZnCafwXCVHSMXvhogOGHdM0LNPhP0KyLCR9ExSCiOJQKlWCEX5DUtiT0hkOUdZQZIQkDE+bwoCkKQpYQwYpJfOm2pgkzadOYYQUwSiAiSr9B4csLnfhVvLfEY7i8smG4xUjE1gqy51kMQzJvCYCtx1wQwlhRWuyuEGJAK/EpZh3t2F09WIUpWyfCX9M4ZwGD3j4I3Sfhu6f48koujKLVV5hMpMbvr15lO/LliUIlMzSEIl1eh1wPY8xQ6MpDMTonB87l8VskvCewZswwVHK2wka8/e6fkWUYY7nQIoZEfrqy8v9CHW0qInkZj4jMkGMLrmKHDUdCaxkVtmd147JkrK4dkQrIZTUiFZLV+jxhgRQD6aKmw8zlGA/Oww8PVprkB4DPHcNPFdFz3FtFT3jGOh9H35xXl7c+L/v1LSS/wdvA//xylAgTUgU4TTiwk+jgEzRbx8DW+AaDWzNvoqt3dMwE5wMW0dBDoXczckuoSwmEUlhcltJr5vYVjpficAtR/QZMbaUPhvOGGnijRaY/Sumd23Ze6qNDBdy5byzLDsp325tkug+1ceqaXmvmhcOhLfn3ZSkqJDcYYFSPr7xWDMyowHaAp20dAZphNgWPen2Ba5bSUJRAhl+bYaXox+46p/gdJpw9jNM0o7pJILrPuWtSLQ+cVNbgXGgmR3Bgiyr6Z0MjW83TI0FOacyIKDg+W00+Pox/JHpNdF0eyqalg5N71Rouiqa47FPIA259IGnd7nXb5mEhuE6DdyAZassBOdkYZkU14FLrwvcPgITLdBkIjBUJgJXg6jZOxWkfQXRIUQTnY+8olzOEFde5SUtM9RZS+JW+cMuN+mejKB2q4lGLc2oko6Pkmh4eyYahnXsTCOfyncFlzWFKcEpy2or3wvB5hgNbLtOH0Uf9A7Td5zedv31crCpzxvFDityr6A6IC0oa/uWEmvzVzLr7cR9r0GcgfDgMgi/XjLvIKQlCX5eQhrtEtL9yKXevoQ07YsgpA1+jZB2G4T0lPxqcP+FC64S7GtyLD4yxkkjydLpBCTNiE4txK91PTVlc+BEJGKpnxXXkMU0vrXazNYTOyW2tp/YqQUwNzmULTOGJu3jZaxVuEDFy9PABU4Gl6XAVb9h0bC1zvO7deGF0ROYu+HunxVut5Wotyuj0t5/ruLgrqDoAbMRFrtev78zNPLePaKYw4rowfHQ2Pfu0zhJPFQDmGXreVcuUexIzqo4tTmwbk7e+mux1fCajyowUR51rLBpqPcSNyQd42hG5RWuhu9foY+SjvZjXMAPXzBCueqZ4DAszAFl+A36+XqCNhIkvrh93bGHWiJtNUbFn6w+0sqndOrfQXV+htc3lttvnEN5sf1eJpUqZDzO0ElOrkwOayc3YiGZsdbdtn1pUdJs97PUe26LjKZLtnc65FPVKu6errl/bNd82Imrbu1vxOaEvvDlHof3F+zWSrIew60BbnsX78e8No3TeI9x9i7FOPe9SDiXcT5miH7zn8X/o3gpXJiTmBozJv5GNchLjjsUJHiaoassIBR1I8zimd/FhI/kErEmxGnZ/cFfCsEM8TzqDvNDX3TzY8xfLcHpy2mfsP0SzK7BKLleozE3X7Yh4B4hyjpr99ZGT/O5Feji7Dv+/SG8ZnW2eutWK/cHXh+0no04l5aNlNVODajnTJNpnxso1zO7G+qe40PFu9U/EotQUv2vE9z+BA==</diagram></mxfile>"> + <defs/> + <g> + <g> + <rect x="0" y="0" width="840" height="840" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 838px; height: 1px; padding-top: 7px; margin-left: 2px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: left; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + ECU + </div> + </div> + </div> + </foreignObject> + <text x="2" y="19" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px"> + ECU + </text> + </switch> + </g> + </g> + <g> + <rect x="10" y="610" width="675" height="140" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 673px; height: 1px; padding-top: 617px; margin-left: 12px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: left; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + baselibs + </div> + </div> + </div> + </foreignObject> + <text x="12" y="629" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px"> + baselibs + </text> + </switch> + </g> + </g> + <g> + <rect x="111" y="220" width="500" height="340" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 498px; height: 1px; padding-top: 227px; margin-left: 113px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: left; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + logging (Scope) + </div> + </div> + </div> + </foreignObject> + <text x="113" y="239" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px"> + logging (Scope) + </text> + </switch> + </g> + </g> + <g> + <path d="M 240 160 L 240 280" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke" style="stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <rect x="180" y="100" width="120" height="60" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 130px; margin-left: 181px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: center; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + application + <br/> + (log source) + </div> + </div> + </div> + </foreignObject> + <text x="240" y="134" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px" text-anchor="middle"> + application... + </text> + </switch> + </g> + </g> + <g> + <rect x="30" y="640" width="420" height="90" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 418px; height: 1px; padding-top: 647px; margin-left: 32px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: left; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + OSAL + </div> + </div> + </div> + </foreignObject> + <text x="32" y="659" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px"> + OSAL + </text> + </switch> + </g> + </g> + <g> + <rect x="916" y="285" width="130" height="60" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 128px; height: 1px; padding-top: 315px; margin-left: 917px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: center; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + Offboard Tooling + </div> + </div> + </div> + </foreignObject> + <text x="981" y="319" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px" text-anchor="middle"> + Offboard Tooling + </text> + </switch> + </g> + </g> + <g> + <rect x="170" y="250" width="370" height="200" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 368px; height: 1px; padding-top: 257px; margin-left: 172px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: left; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + OnBoard + </div> + </div> + </div> + </foreignObject> + <text x="172" y="269" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px"> + OnBoard + </text> + </switch> + </g> + </g> + <g> + <rect x="410" y="280" width="120" height="70" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 315px; margin-left: 411px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: center; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + Daemon + <br/> + -remote logging + </div> + </div> + </div> + </foreignObject> + <text x="470" y="319" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px" text-anchor="middle"> + Daemon... + </text> + </switch> + </g> + </g> + <g> + <path d="M 180 315 L 180 295 L 40 295 L 40 600 L 100 600 L 100 670" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke" style="stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <path d="M 210 350 L 210 600 L 195 600 L 195 670" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke" style="stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <path d="M 270 350 L 270 600 L 295 600 L 295 670" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke" style="stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <rect x="180" y="280" width="120" height="70" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 315px; margin-left: 181px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: center; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + API -lib + <br/> + - file logging + <br/> + - console logging + <div> + - remote logging + </div> + </div> + </div> + </div> + </foreignObject> + <text x="240" y="319" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px" text-anchor="middle"> + API -lib... + </text> + </switch> + </g> + </g> + <g> + <rect x="150" y="670" width="90" height="30" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 88px; height: 1px; padding-top: 685px; margin-left: 151px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: center; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + Filesystem + </div> + </div> + </div> + </foreignObject> + <text x="195" y="689" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px" text-anchor="middle"> + Filesystem + </text> + </switch> + </g> + </g> + <g> + <rect x="60" y="670" width="80" height="30" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 685px; margin-left: 61px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: center; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + log source + <div> + <br/> + </div> + </div> + </div> + </div> + </foreignObject> + <text x="100" y="689" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px" text-anchor="middle"> + log source + </text> + </switch> + </g> + </g> + <g> + <path d="M 577.5 670 L 577.5 615 L 577 555.92" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke" style="stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 600px; margin-left: 580px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: center; color: #000000; background-color: #ffffff; "> + <div style="display: inline-block; font-size: 11px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; background-color: light-dark(#ffffff, var(--ge-dark-color, #121212)); white-space: nowrap; "> + Configuration + </div> + </div> + </div> + </foreignObject> + <text x="580" y="603" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="11px" text-anchor="middle"> + Configuration + </text> + </switch> + </g> + </g> + <g> + <rect x="250" y="670" width="90" height="30" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 88px; height: 1px; padding-top: 685px; margin-left: 251px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: center; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + Stdout + </div> + </div> + </div> + </foreignObject> + <text x="295" y="689" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px" text-anchor="middle"> + Stdout + </text> + </switch> + </g> + </g> + <g> + <path d="M 916 315 L 530 315" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke" style="stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 316px; margin-left: 661px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: center; color: #000000; background-color: #ffffff; "> + <div style="display: inline-block; font-size: 11px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; background-color: light-dark(#ffffff, var(--ge-dark-color, #121212)); white-space: nowrap; "> + Network/UDP + </div> + </div> + </div> + </foreignObject> + <text x="661" y="319" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="11px" text-anchor="middle"> + Network/UDP + </text> + </switch> + </g> + </g> + <g> + <path d="M 300 315 L 410 315" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke" style="stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <a xlink:href="https://eclipse-score.github.io/score/main/score_releases/index.html"> + <g> + <rect x="340" y="940" width="390" height="40" fill="none" stroke="none" pointer-events="all"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 388px; height: 1px; padding-top: 947px; margin-left: 342px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: left; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + https://eclipse-score.github.io/score/main/score_releases/index.html + </div> + </div> + </div> + </foreignObject> + <text x="342" y="959" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px"> + https://eclipse-score.github.io/score/main/score_releases/index.h... + </text> + </switch> + </g> + </g> + </a> + <g> + <rect x="350" y="670" width="90" height="30" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 88px; height: 1px; padding-top: 685px; margin-left: 351px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: center; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + Time + </div> + </div> + </div> + </foreignObject> + <text x="395" y="689" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px" text-anchor="middle"> + Time + </text> + </switch> + </g> + </g> + <g> + <rect x="532.5" y="670" width="90" height="30" fill="#ffffff" stroke="#000000" pointer-events="all" style="fill: light-dark(#ffffff, var(--ge-dark-color, #121212)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/> + </g> + <g> + <g transform="translate(-0.5 -0.5)"> + <switch> + <foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"> + <div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 88px; height: 1px; padding-top: 685px; margin-left: 534px;"> + <div style="box-sizing: border-box; font-size: 0; text-align: center; color: #000000; "> + <div style="display: inline-block; font-size: 12px; font-family: "Helvetica"; color: light-dark(#000000, #ffffff); line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "> + json + </div> + </div> + </div> + </foreignObject> + <text x="578" y="689" fill="light-dark(#000000, #ffffff)" font-family=""Helvetica"" font-size="12px" text-anchor="middle"> + json + </text> + </switch> + </g> + </g> + </g> + <switch> + <g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/> + <a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"> + <text text-anchor="middle" font-size="10px" x="50%" y="100%"> + Text is not SVG - cannot display + </text> + </a> + </switch> +</svg> diff --git a/docs/features/logging/docs/architecture/.gitkeep b/docs/features/logging/docs/architecture/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/features/logging/docs/architecture/index.rst b/docs/features/logging/docs/architecture/index.rst new file mode 100644 index 0000000..f18e503 --- /dev/null +++ b/docs/features/logging/docs/architecture/index.rst @@ -0,0 +1,141 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _feature_architecture_logging: + +Logging Feature Architecture +============================ + +.. document:: logging Architecture + :id: doc__logging_architecture + :status: draft + :safety: ASIL_B + :security: NO + :realizes: wp__feature_arch + :tags: template + +.. attention:: + The above directive must be updated according to your Feature. + + - Modify ``Your Feature Name`` to be your Feature Name + - Modify ``id`` to be your Feature Name in upper snake case preceded by ``doc__`` and followed by ``_architecture`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Overview +-------- +Brief summary + +Description +----------- + +General Description + +.. Design Decisions - For the documentation of the decision the :need:`gd_temp__change_decision_record` can be used. + +Design Constraints + +Requirements +------------ + +.. code-block:: none + + .. needtable:: Overview of Feature Requirements + :style: table + :columns: title;id + :filter: search("feat_arch_sta__archdes$", "fulfils_back") + :colwidths: 70,30 + + +Rationale Behind Architecture Decomposition +******************************************* +mandatory: a motivation for the decomposition + +.. note:: Common decisions across features / cross cutting concepts is at the high level. + +Static Architecture +------------------- +.. + .. feat_arc_sta:: Static View + :id: feat_arc_sta__logging__static_view + :security: YES + :safety: ASIL_B + :status: valid + :fulfils: feat_req__logging__timestamping_original + :includes: feat__logging + .. needarch:: + :scale: 50 + :align: center + + {{ draw_feature(need(), needs) }} + + +.. feat:: Logging + :id: feat__logging + :security: YES + :safety: ASIL_B + :status: valid + :includes: logic_arc_int__log_cpp__logging, logic_arc_int__log_rust__logging_rust + :consists_of: comp__log_rust, comp__log_cpp, comp__log_bridge, comp__datarouter, comp__recorders + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_feature(need(), needs) }} + +Dynamic Architecture +-------------------- + +.. .. feat_arc_dyn:: Dynamic View +.. :id: feat_arc_dyn__logging__dynamic_view +.. :security: YES +.. :safety: ASIL_B +.. :status: invalid +.. :fulfils: feat_req__feature_name__some_title + + put here a sequence diagram + +Logical Interfaces +------------------ + + + + +.. logic_arc_int:: buffer + :id: logic_arc_int__logging__buffer + :security: YES + :safety: ASIL_B + :status: valid + + + + + +.. logic_arc_int_op:: Log + :id: logic_arc_int_op__logging__log + :security: YES + :safety: ASIL_B + :status: valid + :included_by: logic_arc_int__log_cpp__logging + + +Architecture draft from CFT discussion +-------------------------------------- + +.. figure:: ../../_assets/feat_arc_sta__log__logging.drawio.svg + :align: center + :name: fr_logging_arc + + Architecture draft from CFT discussion diff --git a/docs/features/logging/docs/glossary.rst b/docs/features/logging/docs/glossary.rst new file mode 100644 index 0000000..dc146bc --- /dev/null +++ b/docs/features/logging/docs/glossary.rst @@ -0,0 +1,47 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +Glossary +######## +.. glossary:: + + logging node + ECU or Partition (real or virtual) which generates log messages + + DLT + Diagnostic Log and Trace + + framework + Framework is a structured and extensible foundation for developing specific types of functionality in this case, logging. It supplies a set of default behaviors and configurable options, allowing developers to tailor and extend its capabilities to meet their application and system need. + + platform + Platform is the execution environment on which S-CORE runs. It includes, for example, hardware (HW), operating system (OS), ... + + component + Component is a S-CORE component + + log level + Log Level is the severity of a log message, necessary to categorize logs based on their importance e.g., FATAL, ERROR, WARN, INFO, DEBUG, VERBOSE such as in DLT + + logging entity + SW entity which generates log messages + + logging entity identifier + unique identifier for the logging entity, e.g., ECU ID / application ID / context ID, similar to DLT. + + log storage strategy + strategy to write/sync the cached log messages in the log storage location e.g., on system shutdown, on each message, on demand, on file size, on cache size, with circular or linear buffer + + QoS + Quality of Service diff --git a/docs/features/logging/docs/requirements/.gitkeep b/docs/features/logging/docs/requirements/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/features/logging/docs/requirements/mw-fr_logging_req.rst b/docs/features/logging/docs/requirements/mw-fr_logging_req.rst new file mode 100644 index 0000000..6bf1c42 --- /dev/null +++ b/docs/features/logging/docs/requirements/mw-fr_logging_req.rst @@ -0,0 +1,490 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + + + +Requirements +############ + + + +.. feat_req:: Timestamping - Local Timestamp + :id: feat_req__logging__timestamping_local + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support local timestamps for each log entry. + +.. feat_req:: Timestamping - Original Timestamp + :id: feat_req__logging__timestamping_original + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support original timestamps for routed log entries. + +.. feat_req:: Timestamping - Timestamp Synchronization + :id: feat_req__logging__timestamping_sync + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support timestamp synchronization for log entries coming from different :term:`logging nodes <logging node>`. + +.. feat_req:: Log Severity Levels + :id: feat_req__logging__severity_levels + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging framework shall support a log level for each log entry. + +.. feat_req:: Log Prioritization + :id: feat_req__logging__prioritization + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging framework shall prioritize logs in case of resource conflicts to ensure critical logs are not lost. + +.. feat_req:: Logging of Early Startup Events + :id: feat_req__logging__early_startup + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support logging of early startup events to capture critical initialization information. + +.. feat_req:: Log entity Identifier + :id: feat_req__logging__entity_identifier + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support :term:`logging entity identifiers<logging entity identifier>` for each log entry. + +.. feat_req:: Log Filtering - Log Levels + :id: feat_req__logging__filtering_log_levels + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support filtering by :term:`log levels <Log level>`. + +.. feat_req:: Log Filtering - Logging Entity ID + :id: feat_req__logging__filtering_entity_id + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support filtering by :term:`logging entity identifiers<logging entity identifier>`. + +.. feat_req:: Message Loss Detection - Detection and Reporting + :id: feat_req__logging__message_loss_detection + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall detect and report any message loss. + +.. feat_req:: Message Loss Detection - Graceful Handling + :id: feat_req__logging__message_loss_handling + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall provide mechanisms to handle message loss gracefully. + + Additional Information: e.g. buffering or prioritizing critical messages + +.. feat_req:: Context-Specific Log Level Activation + :id: feat_req__logging__context_log_level + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall allow context-specific :term:`log level` activation at runtime to enable fine-grained control over logging behavior. + +.. feat_req:: Log Sources - User Application + :id: feat_req__logging__log_sources_user_app + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support user application as log source. + +.. feat_req:: Log Sources - Component and Platform + :id: feat_req__logging__log_sources + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support :term:`component` features and :term:` platform` as log sources. + +.. feat_req:: Log Sinks - Console + :id: feat_req__logging__log_sinks_console + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support console as a log sink. + +.. feat_req:: Log Sinks - Local File System + :id: feat_req__logging__log_sinks_local_fs + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support local file system as log sink. + + + +.. feat_req:: Log Sinks - Cloud Native Drive + :id: feat_req__logging__log_sinks_cloud_drive + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support cloud-native drives via network as log sinks. + +.. feat_req:: Log Sinks - Network + :id: feat_req__logging__log_sinks_network + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support network channels, including a second dedicated Ethernet channel, as log sinks. + +.. feat_req:: Log Sinks - Stdout for Unit Tests + :id: feat_req__logging__log_sinks_stdout + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall ensure logs appear on stdout when running unit tests. + +.. feat_req:: Previous boot logging + :id: feat_req__logging__boot_logging + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__boot_logging + :status: valid + + The logging :term:`framework` shall support logging of data to memory which survives a reboot + cycle. + +.. feat_req:: Configuration - Log Level + :id: feat_req__logging__config_log_level + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support configuration of :term:`log levels <Log level>`. + +.. feat_req:: Log Sinks - Storage Device + :id: feat_req__logging__sink_device + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support configuration of the log storage device. + +.. feat_req:: Log Sinks - multiple Storage Device + :id: feat_req__logging__sink_multiple_device + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support multiple log storage devices. + +.. feat_req:: Log Sinks - Storage Strategy + :id: feat_req__logging__sink_strategy + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support configurable :term:`log storage strategy`. + +.. feat_req:: Configuration - Buffer Size + :id: feat_req__logging__config_buffer_size + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall allow configuration of internal buffers sizes. + +.. feat_req:: Configuration - Storage Size + :id: feat_req__logging__config_storage_size + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall allow configuration of storage size per log file. + +.. feat_req:: Configuration - Permission Settings + :id: feat_req__logging__config_permissions + :reqtype: Functional + :security: YES + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall allow configuration of permission settings for log access. + +.. feat_req:: Configuration - Log Filter + :id: feat_req__logging__config_log_filter + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall allow configuration of log filters. + +.. feat_req:: Configuration - Logging Entity ID + :id: feat_req__logging__config_entity_id + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall allow configuration of logging entity IDs. + +.. feat_req:: Configuration - On-Demand Functionality + :id: feat_req__logging__config_on_demand + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support on-demand functionality, such as enabling or disabling log storage. + +.. feat_req:: Configuration - Fallback Configurations + :id: feat_req__logging__config_fallback + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall provide fallback configurations, such as application-wide or system-wide defaults. + +.. feat_req:: Configuration - Custom Types Extension + :id: feat_req__logging__config_custom_types + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall allow extensions for custom log types. + +.. feat_req:: Error Handling - Recoverable Errors + :id: feat_req__logging__error_handling_recoverable + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + In case of recoverable error, the logging :term:`framework` shall continue the current operations. + +.. feat_req:: Error Handling - Non-Recoverable Errors + :id: feat_req__log__err_handling_nonrec + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + In case of non-recoverable error, the logging :term:`framework` shall deactivate silently and set an error state reported on shutdown. + +.. feat_req:: Error Handling - Application Isolation + :id: feat_req__logging__error_handling_isolation + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall ensure that user applications are not affected by logging :term:`framework` errors. + +.. feat_req:: Compatibility - Supported Operating Systems + :id: feat_req__logging__compat_os + :reqtype: Interface + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall support QNX and Linux operating systems (encapsulated via OSAL). + +.. feat_req:: Compatibility - Supported Programming Languages + :id: feat_req__logging__compat_languages + :reqtype: Interface + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support, stkh_req__dev_experience__prog_languages + :status: valid + + The logging :term:`framework` shall support C++, Rust, and Python programming languages. + +.. feat_req:: Resource Consumption - Storage + :id: feat_req__logging__resource_storage + :reqtype: Non-Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall minimize storage resource consumption. + +.. feat_req:: Resource Consumption - Communication Channel + :id: feat_req__logging__resource_comm_channel + :reqtype: Non-Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall minimize communication channel resource consumption. + +.. feat_req:: Resource Consumption - Runtime Resources + :id: feat_req__logging__resource_runtime + :reqtype: Non-Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall minimize runtime resource consumption. + +.. feat_req:: Resource Consumption - Performance Impact + :id: feat_req__logging__resource_performance + :reqtype: Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall have low impact on overall system performance. + +.. feat_req:: Quality of Service - Message Handling + :id: feat_req__logging__qos_message_handling + :reqtype: Non-Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall provide:term:` QoS` for handling overflows or dropping log messages. +.. ist "rovide QoS for handling overflows or dropping log messages." doppelt zu den loos detection req.? + +.. feat_req:: Compatibility - DLT Protocol + :id: feat_req__logging__compat_dlt + :reqtype: Interface + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support, stkh_req__overall_goals__enable_cooperation + :status: valid + + The logging :term:`framework` shall be :term:`DLT` compatible. + + Additional Information: support for DLT message format, sending and receiving DLT messages, and integration with existing DLT tools and infrastructure. + +.. feat_req:: Security - Log File Access + :id: feat_req__logging__security_log_access + :reqtype: Non-Functional + :security: YES + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support, stkh_req__dependability__security_features + :status: valid + + The logging :term:`framework` shall ensure that only authorized users can access log files. + +.. feat_req:: Safety - ASIL Level Support + :id: feat_req__logging__asil_support + :reqtype: Non-Functional + :security: NO + :safety: ASIL_B + :satisfies: stkh_req__functional_req__safe_comput + :status: valid + + The logging :term:`framework` shall support the ASIL level of the user function to ensure compliance with the safety requirements of the application. + + Additional Information: Freedom from interfernce must be guaranteed with regard to the calling components. + +.. feat_req:: Safety - System Classification + :id: feat_req__logging__system_class + :reqtype: Non-Functional + :security: NO + :safety: QM + :satisfies: stkh_req__dev_experience__logging_support + :status: valid + + The logging :term:`framework` shall be classified according to the overall system's safety concept if logging information is part of the verification strategy. diff --git a/docs/features/logging/docs/safety_analysis/.gitkeep b/docs/features/logging/docs/safety_analysis/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/features/logging/docs/safety_planning/.gitkeep b/docs/features/logging/docs/safety_planning/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/features/logging/docs/verification/.gitkeep b/docs/features/logging/docs/verification/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/features/logging/index.rst b/docs/features/logging/index.rst new file mode 100644 index 0000000..c4d1836 --- /dev/null +++ b/docs/features/logging/index.rst @@ -0,0 +1,24 @@ +.. + # ******************************************************************************* + # Copyright (c) 2024 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +Logging +####### + +.. toctree:: + :maxdepth: 1 + + ./mw-fr_logging.rst + ./docs/requirements/mw-fr_logging_req.rst + ./docs/architecture/index.rst + ./docs/glossary.rst diff --git a/docs/features/logging/mw-fr_logging.rst b/docs/features/logging/mw-fr_logging.rst new file mode 100644 index 0000000..42e7dcf --- /dev/null +++ b/docs/features/logging/mw-fr_logging.rst @@ -0,0 +1,210 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +Feature Request +############### + +.. document:: doc__logging + :id: doc__logging + :status: draft + :safety: ASIL_B + :security: YES + :tags: feature_request + :realizes: wp__feat_request + + +Feature flag +============ + +To activate this feature, use the following feature flag: + +``experimental_logging`` + +Abstract +======== + +This feature request proposes the development of a safe, efficient and robust logging framework within S-CORE. + + +Motivation +========== + +- currently no solution available in the score platform + +Rationale +========= + +Logging provides the possibility to understand the running system by capturing detailed information about system +events and application-level activities. + +Specification +============= + +[Describe the requirements, architecture of any new feature.] [or] +[Describe the change to requirements, architecture, implementation, process, documentation, infrastructure of any change request.] + +Functionality +------------- + +Logging has to support the following features: + +- Timestamping + + - local timestamp for each log entry + - original timestamp for routed log entries + - timestamp synchronization for log entries coming from different logging nodes- + +- Log severity levels +- Log prioritization in case of resource conflicts +- logging of early startup events +- Log filtering + + - Support application and context identifier like in DLT + - Filtering by log levels for components and application level + - Out of scope "time" (tooling topic) + - logs filtering by logging entity ID (e.g., ECU ID, Application ID, Context ID such as in DLT) + - logs filtering by log level (e.g., FATAL, ERROR, WARN, INFO, DEBUG, VERBOSE such as in DLT) + + .. - Filtering options: it should have filter on app id and more fine-tuned filters on context ids. + +- message loss detection + + - optional functionality for logging. Important for tracing. + - Message loss detection + + - The logging framework must detect and report any message loss. + - It should provide mechanisms to handle message loss gracefully, such as buffering or prioritizing critical messages. + - The log consumer must be informed about any message loss to ensure the trustworthiness of the logs. + - would become mandatory in case verification is done via logging feature (not recommended) + +- Context specific log level activation at runtime + +Log Sources +----------- + +- user application +- component features & platform + +Log Sinks +--------- +- log sinks shall be transparent to the application (e.g. by a facade ) +- console +- File system + + - local + - external mounted PCIe Drive + - Cloud native drive via network + +- Network (incl. second dedicated Ethernet Channel) +- Logs shall appear on stdout when running unit tests + +Configuration +------------- + +- Log level +- Log Sinks + + - Log storage device + - Log storage strategy (e.g., on system shutdown, on each message, on demand, on file size, on cache size, with circular or linear buffer) + +- Buffer size +- Storage size (e.g. storage size of log files) +- Permission settings +- log filter +- Logging entity ID (e.g., ECU ID, Application ID, Context ID such as in DLT) +- On-demand functionality (e.g., enable / disable the log storage) +- Provide fallback configs. E.g.: App, System-wide + +- Possibility to provide an extension for custom types + +Error handling +-------------- + +- reboot/reset +- On logging errors, the framework should continue if recoverable; otherwise, deactivate silently and set an error state reported on shutdown. +- The user application should not be affected by logging framework errors. + +Context +------- + +- Supported operating system: QNX, Linux (encapsulation via OSAL) +- Supported programming languages: C++, Rust, Python (e.g. for tests) + +Resource consumption +-------------------- + +- Storage +- Communication Channel +- Runtime resources +- Low impact on overall performance ---> QoS for handling overflows/dropping log messages + +Norms/Standards +--------------- +The logging framework should be compatible with the Diagnostic Log and Trace (DLT) protocol. This includes: + +- Support for DLT message format +- Ability to send and receive DLT messages +- Integration with existing DLT tools and infrastructure + +Backwards Compatibility +======================= +\- + +Security Impact +=============== + +- only authorized users should be able to access the log files + +Safety Impact +============= + +- The interface should support the ASIL level of the user function. +- Dependent on the Safety concept of the over all system, the logging should be classified accordingly. + That could be the case if the logging information are part of the verification strategy.. + +License Impact +============== + +- not known + +How to Teach This +================= + +How to Use: Logging Guideline + + +Definitions +=========== + +Logging +------- + +Write out some message +General progress description (incl. Context) +- state changes +- Infos +- errors + +When logging from a library, it shall be possible to easily associate the logs to the library. A solution could be to provide contexts. + +Tracing +------- + +Example - User need to correlate kernel traces to user traces for debugging , analyzing etc +Follow the control flow (on function call basis)of the application. + +Recompute +--------- + +All data to recompute a module (Input, Output, States) diff --git a/docs/features/logging/mw-fr_logging_DD_Input.rst_tmp b/docs/features/logging/mw-fr_logging_DD_Input.rst_tmp new file mode 100644 index 0000000..2576579 --- /dev/null +++ b/docs/features/logging/mw-fr_logging_DD_Input.rst_tmp @@ -0,0 +1,44 @@ +.. + # ******************************************************************************* + # Copyright (c) 2024 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +This document includes the detailed design findings from the feature request review. + +Logging +####### + +Specification +============= +Context +------- +.. related feature from feature request +- Supported programming languages: C++, Rust, Python (e.g. for tests) + +.. detailed design finding +For Rust, we would like to be able to use the log crate. It provides an (allocation-free) facade without forcing a specific logger implementation. Advantages of using this facade: + +We stay with language best-practices. +New contributors directly feel at home with the logging. +Any library dependency which we might use probably logs against this facade. So we would get logs of dependencies for free by using it as well and implementing a logger for the facade. +There might be comparable defacto standards for C++ and Python. + + +Resource consumption +-------------------- +.. related feature from feature request +- Runtime ressources +- Low impact on overall performance ---> QoS for handling overflows/dropping log messages + +.. detailed design finding +Ideally, in a language like Rust, logging messages should be possible without allocations for individual logs. +Using the defacto standard log crate as facade, implementors of this facade should not allocate to write / forward log messages. diff --git a/docs/features/logging/tests/integration-tests/.gitkeep b/docs/features/logging/tests/integration-tests/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/file_recorder/docs/architecture/index.rst b/docs/file_recorder/docs/architecture/index.rst new file mode 100644 index 0000000..8a8cc6b --- /dev/null +++ b/docs/file_recorder/docs/architecture/index.rst @@ -0,0 +1,146 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_architecture_file_recorder: + +file_recorder Component Architecture +==================================== + +.. document:: file_recorder Architecture + :id: doc__file_recorder_architecture + :status: draft + :safety: ASIL_B + :security: NO + :realizes: wp__component_arch + :tags: template + +.. attention:: + The above directive must be updated according to your needs. + + - Modify ``Your Component Name`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` and followed by ``_architecture`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Overview +-------- +<Brief summary> + +Requirements Linked to Component Architecture +--------------------------------------------- + +.. code-block:: none + + .. needtable:: Overview of Component Requirements + :style: table + :columns: title;id + :filter: search("comp_arch_sta__archdes$", "fulfils_back") + :colwidths: 70,30 + +Description +----------- + +<General Description> + +<Design Constraints> + +Rationale Behind Architecture Decomposition +******************************************* + +Mandatory: A motivation for the decomposition or reason for not further splitting it into internal components. + +.. note:: Common decisions across components / cross cutting concepts is at the higher level. + +Static Architecture +------------------- + +The components are designed to cover the expectations from the feature architecture +(i.e. if already exists a definition it should be taken over and enriched). + +.. comp:: file_recorder + :id: comp__file_recorder + :security: YES + :safety: ASIL_B + :status: invalid + :implements: logic_arc_int__log_cpp__recorder + :uses: logic_arc_int__baselibs__filesystem + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_component(need(), needs) }} +.. + TEMPLATE: Uncomment and fill out the following comp_arc_sta directive: + + .. comp_arc_sta:: Component Name (Static View) + :id: comp_arc_sta__component_name__static_view + :security: YES + :safety: ASIL_B + :status: invalid + :includes: comp_arc_sta__component_name__2 + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_component(need(), needs) }} + +Dynamic Architecture +-------------------- + +.. + TEMPLATE: Uncomment and customize the comp_arc_dyn directive: + + .. comp_arc_dyn:: Dynamic View + :id: comp_arc_dyn__component_name__dynamic_view + :security: YES + :safety: ASIL_B + :status: invalid + + Put here a sequence diagram + + +Interfaces +---------- +.. + .. real_arc_int:: <Title> + :id: real_arc_int__<component>__<Title> + :security: <YES|NO> + :safety: <QM|ASIL_B> + :fulfils: <link to component requirement id> + :language: cpp + +Internal Components +------------------- + +.. + TEMPLATE: Uncomment and customize the comp_arc_sta directive: + + .. comp_arc_sta:: Component Name Static View + :id: comp_arc_sta__component_name__2 + :status: invalid + :safety: ASIL_B + :security: YES + + No architecture but detailed design + +.. note:: + Architecture can be split into multiple files. At component level the public interfaces to be used by the user and tester to be shown. + +.. attention:: + The above directives must be updated according to your component architecture. + + - Replace the example content by the real content + - Set the status to valid and start the review/merge process diff --git a/docs/file_recorder/docs/index.rst b/docs/file_recorder/docs/index.rst new file mode 100644 index 0000000..718321c --- /dev/null +++ b/docs/file_recorder/docs/index.rst @@ -0,0 +1,173 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_file_recorder: + +file_recorder +############# + +.. note:: Document header + +.. document:: file_recorder + :id: doc__file_recorder + :status: draft + :safety: ASIL_B + :security: NO + :realizes: wp__cmpt_request + :tags: template + +.. attention:: + The above directive must be updated according to your Component. + + - Modify ``document`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Abstract +======== + +[A short (~200 word) description of the contribution being addressed.] + + +Motivation +========== + +[Clearly explain why the existing platform/project solution is inadequate to address the topic that the CR solves.] + +.. note:: + The motivation is critical for CRs that want to change the existing components. + It should clearly explain why the existing solution is inadequate to address the topic that the CR solves. + Motivation may based on criteria as resource requirements, scheduling issues, risks, benefits, etc. + CRs submissions without sufficient motivation may be rejected. + + + +Rationale +========= + +[Describe why particular design decisions were made.] + +.. note:: + The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion. + For the documentation of the decision the :need:`gd_temp__change_decision_record` can be used. + +Specification +============= + +[Describe the requirements, architecture of any new component.] or +[Describe the change to requirements, architecture, implementation, documentation of any change request.] + +.. note:: + A CR shall specify the component requirements as part of our platform/project. + Thereby the :need:`rl__project_lead` will approve these requirements as part of accepting the CR (e.g. merging the PR with the CR). + + +Backwards Compatibility +======================= + +[Describe potential impact (especially including safety and security impacts) and severity on pre-existing platform/project elements.] + + +Security Impact +=============== + +[How could a malicious user take advantage of this new/modified component?] + +.. note:: + If there are security concerns in relation to the CR, those concerns should be explicitly written out to make sure reviewers of the CR are aware of them. + +Which security requirements are affected or has to be changed? +Could the new/modified component enable new threat scenarios? +Could the new/modified component enable new attack paths? +Could the new/modified component impact functional safety? +If applicable, which additional security measures must be implemented to mitigate the risk? + +.. note:: + Use Security Software Critically Analysis, Vulnerability Analysis. + [Methods will be defined later in Process area Security Analysis] + + +Safety Impact +============= + +[How could the safety be impacted by the new/modified component?] + +.. note:: + If there are safety concerns in relation to the CR, those concerns should be explicitly written out to make sure reviewers of the CR are aware of them. + +Which safety requirements are affected or has to be changed? +Could the new/modified component be a potential common cause or cascading failure initiator? +If applicable, which additional safety measures must be implemented to mitigate the risk? + +.. note:: + Use Dependency Failure Analysis and/or Safety Software Critically Analysis. + [Methods will be defined later in Process area Safety Analysis] + +For new feature/component contributions: + +[What is the expected ASIL level?] +[What is the expected classification of the contribution?] + +.. note:: + Use the component classification method here to classify your component, if it shall to be used in a safety context: :need:`gd_temp__component_classification`. + +License Impact +============== + +[How could the copyright impacted by the license of the new contribution?] + + +How to Teach This +================= + +[How to teach users, new and experienced, how to apply the CR to their work.] + +.. note:: + For a CR that adds new functionality or changes behavior, it is helpful to include a section on how to teach users, new and experienced, how to apply the CR to their work. + +Rejected Ideas +============== + +[Why certain ideas that were brought while discussing this CR were not ultimately pursued.] + +.. note:: + Throughout the discussion of a CR, various ideas will be proposed which are not accepted. + Those rejected ideas should be recorded along with the reasoning as to why they were rejected. + This both helps record the thought process behind the final version of the CR as well as preventing people from bringing up the same rejected idea again in subsequent discussions. + In a way this section can be thought of as a breakout section of the Rationale section that is focused specifically on why certain ideas were not ultimately pursued. + + + +Open Issues +=========== + +[Any points that are still being decided/discussed.] + +.. note:: + While a CR is in draft, ideas can come up which warrant further discussion. + Those ideas should be recorded so people know that they are being thought about but do not have a concrete resolution. + This helps make sure all issues required for the CR to be ready for consideration are complete and reduces people duplicating prior discussion. + + + +Footnotes +========= + +[A collection of footnotes cited in the CR, and a place to list non-inline hyperlink targets.] + +.. toctree:: + :hidden: + + architecture/index.rst diff --git a/docs/index.rst b/docs/index.rst index 2667bd1..24cdf21 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -80,3 +80,47 @@ Example: } This enables conditional behavior (e.g., choosing `clang-tidy` for C++ or `clippy` for Rust). + + +Module Documents +================ + +.. mod:: logging + :id: mod__logging + :includes: comp__log_bridge, comp__datarouter, comp__recorders + :status: valid + :safety: ASIL_B + :security: YES + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_module(need(), needs) }} + +.. _logging_module_docs: + +Features +======== + +.. toctree:: + :titlesonly: + :maxdepth: 1 + :glob: + + ./features/*/index + +Components +========== + +.. toctree:: + :titlesonly: + :maxdepth: 2 + :glob: + + ./data_router_recorder/docs/index + ./recorders/docs/index + ./datarouter/docs/index + ./file_recorder/docs/index + ./log_bridge/docs/index + diff --git a/docs/log_bridge/docs/architecture/index.rst b/docs/log_bridge/docs/architecture/index.rst new file mode 100644 index 0000000..d0488a8 --- /dev/null +++ b/docs/log_bridge/docs/architecture/index.rst @@ -0,0 +1,147 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_architecture_log_bridge: + +Log Bridge Component Architecture +================================= + +.. document:: log_bridge Architecture + :id: doc__log_bridge_architecture + :status: draft + :safety: ASIL_B + :security: NO + :realizes: wp__component_arch + :tags: template + +.. attention:: + The above directive must be updated according to your needs. + + - Modify ``Your Component Name`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` and followed by ``_architecture`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Overview +-------- +<Brief summary> + +Requirements Linked to Component Architecture +--------------------------------------------- + +.. code-block:: none + + .. needtable:: Overview of Component Requirements + :style: table + :columns: title;id + :filter: search("comp_arch_sta__archdes$", "fulfils_back") + :colwidths: 70,30 + +Description +----------- + +<General Description> + +<Design Decisions - For the documentation of the decision the :need:`gd_temp__change_decision_record` can be used.> + +<Design Constraints> + +Rationale Behind Architecture Decomposition +******************************************* + +Mandatory: A motivation for the decomposition or reason for not further splitting it into internal components. + +.. note:: Common decisions across components / cross cutting concepts is at the higher level. + +Static Architecture +------------------- + +The components are designed to cover the expectations from the feature architecture +(i.e. if already exists a definition it should be taken over and enriched). + +.. comp:: log_bridge + :id: comp__log_bridge + :security: YES + :safety: ASIL_B + :status: invalid + :implements: logic_arc_int__log_rust__score_logger + :uses: logic_arc_int__log_cpp__recorder + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_component(need(), needs) }} +.. + TEMPLATE: Uncomment and fill out the following comp_arc_sta directive: + + .. comp_arc_sta:: Component Name (Static View) + :id: comp_arc_sta__component_name__static_view + :security: YES + :safety: ASIL_B + :status: invalid + :implements: logic_arc_int__feature_name__interface_name1 + :fulfils: comp_req__component_name__some_title + :includes: comp_arc_sta__component_name__2 + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_component(need(), needs) }} + +Dynamic Architecture +-------------------- + +.. + TEMPLATE: Uncomment and customize the comp_arc_dyn directive: + + .. comp_arc_dyn:: Dynamic View + :id: comp_arc_dyn__component_name__dynamic_view + :security: YES + :safety: ASIL_B + :status: invalid + :fulfils: comp_req__component_name__some_title + + Put here a sequence diagram + + +Interfaces +---------- + + +Internal Components +------------------- + +.. + TEMPLATE: Uncomment and customize the comp_arc_sta directive: + + .. comp_arc_sta:: Component Name Static View + :id: comp_arc_sta__component_name__2 + :status: invalid + :safety: ASIL_B + :security: YES + :fulfils: comp_req__component_name__some_title + :implements: logic_arc_int__feature_name__interface_name1 + + No architecture but detailed design + +.. note:: + Architecture can be split into multiple files. At component level the public interfaces to be used by the user and tester to be shown. + +.. attention:: + The above directives must be updated according to your component architecture. + + - Replace the example content by the real content (according to :need:`gd_guidl__arch_design`) + - Set the status to valid and start the review/merge process diff --git a/docs/log_bridge/docs/index.rst b/docs/log_bridge/docs/index.rst new file mode 100644 index 0000000..3cca3ec --- /dev/null +++ b/docs/log_bridge/docs/index.rst @@ -0,0 +1,173 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_log_bridge: + +log_bridge +########## + +.. note:: Document header + +.. document:: log_bridge + :id: doc__log_bridge + :status: draft + :safety: ASIL_B + :security: NO + :realizes: wp__cmpt_request + :tags: template + +.. attention:: + The above directive must be updated according to your Component. + + - Modify ``document`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Abstract +======== + +[A short (~200 word) description of the contribution being addressed.] + + +Motivation +========== + +[Clearly explain why the existing platform/project solution is inadequate to address the topic that the CR solves.] + +.. note:: + The motivation is critical for CRs that want to change the existing components. + It should clearly explain why the existing solution is inadequate to address the topic that the CR solves. + Motivation may based on criteria as resource requirements, scheduling issues, risks, benefits, etc. + CRs submissions without sufficient motivation may be rejected. + + + +Rationale +========= + +[Describe why particular design decisions were made.] + +.. note:: + The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion. + For the documentation of the decision the :need:`gd_temp__change_decision_record` can be used. + +Specification +============= + +[Describe the requirements, architecture of any new component.] or +[Describe the change to requirements, architecture, implementation, documentation of any change request.] + +.. note:: + A CR shall specify the component requirements as part of our platform/project. + Thereby the :need:`rl__project_lead` will approve these requirements as part of accepting the CR (e.g. merging the PR with the CR). + + +Backwards Compatibility +======================= + +[Describe potential impact (especially including safety and security impacts) and severity on pre-existing platform/project elements.] + + +Security Impact +=============== + +[How could a malicious user take advantage of this new/modified component?] + +.. note:: + If there are security concerns in relation to the CR, those concerns should be explicitly written out to make sure reviewers of the CR are aware of them. + +Which security requirements are affected or has to be changed? +Could the new/modified component enable new threat scenarios? +Could the new/modified component enable new attack paths? +Could the new/modified component impact functional safety? +If applicable, which additional security measures must be implemented to mitigate the risk? + +.. note:: + Use Security Software Critically Analysis, Vulnerability Analysis. + [Methods will be defined later in Process area Security Analysis] + + +Safety Impact +============= + +[How could the safety be impacted by the new/modified component?] + +.. note:: + If there are safety concerns in relation to the CR, those concerns should be explicitly written out to make sure reviewers of the CR are aware of them. + +Which safety requirements are affected or has to be changed? +Could the new/modified component be a potential common cause or cascading failure initiator? +If applicable, which additional safety measures must be implemented to mitigate the risk? + +.. note:: + Use Dependency Failure Analysis and/or Safety Software Critically Analysis. + [Methods will be defined later in Process area Safety Analysis] + +For new feature/component contributions: + +[What is the expected ASIL level?] +[What is the expected classification of the contribution?] + +.. note:: + Use the component classification method here to classify your component, if it shall to be used in a safety context: :need:`gd_temp__component_classification`. + +License Impact +============== + +[How could the copyright impacted by the license of the new contribution?] + + +How to Teach This +================= + +[How to teach users, new and experienced, how to apply the CR to their work.] + +.. note:: + For a CR that adds new functionality or changes behavior, it is helpful to include a section on how to teach users, new and experienced, how to apply the CR to their work. + +Rejected Ideas +============== + +[Why certain ideas that were brought while discussing this CR were not ultimately pursued.] + +.. note:: + Throughout the discussion of a CR, various ideas will be proposed which are not accepted. + Those rejected ideas should be recorded along with the reasoning as to why they were rejected. + This both helps record the thought process behind the final version of the CR as well as preventing people from bringing up the same rejected idea again in subsequent discussions. + In a way this section can be thought of as a breakout section of the Rationale section that is focused specifically on why certain ideas were not ultimately pursued. + + + +Open Issues +=========== + +[Any points that are still being decided/discussed.] + +.. note:: + While a CR is in draft, ideas can come up which warrant further discussion. + Those ideas should be recorded so people know that they are being thought about but do not have a concrete resolution. + This helps make sure all issues required for the CR to be ready for consideration are complete and reduces people duplicating prior discussion. + + + +Footnotes +========= + +[A collection of footnotes cited in the CR, and a place to list non-inline hyperlink targets.] + +.. toctree:: + :hidden: + + architecture/index.rst diff --git a/docs/recorders/docs/architecture/index.rst b/docs/recorders/docs/architecture/index.rst new file mode 100644 index 0000000..f33cbc3 --- /dev/null +++ b/docs/recorders/docs/architecture/index.rst @@ -0,0 +1,146 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_architecture_recorders: + +recorders Component Architecture +================================ + +.. document:: recorders Architecture + :id: doc__recorders_architecture + :status: draft + :safety: ASIL_B + :security: NO + :realizes: wp__component_arch + :tags: template + +.. attention:: + The above directive must be updated according to your needs. + + - Modify ``Your Component Name`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` and followed by ``_architecture`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Overview +-------- +<Brief summary> + +Requirements Linked to Component Architecture +--------------------------------------------- + +.. code-block:: none + + .. needtable:: Overview of Component Requirements + :style: table + :columns: title;id + :filter: search("comp_arch_sta__archdes$", "fulfils_back") + :colwidths: 70,30 + +Description +----------- + +<General Description> + +<Design Decisions - For the documentation of the decision the :need:`gd_temp__change_decision_record` can be used.> + +<Design Constraints> + +Rationale Behind Architecture Decomposition +******************************************* + +Mandatory: A motivation for the decomposition or reason for not further splitting it into internal components. + +.. note:: Common decisions across components / cross cutting concepts is at the higher level. + +Static Architecture +------------------- + +The components are designed to cover the expectations from the feature architecture +(i.e. if already exists a definition it should be taken over and enriched). + +.. comp:: recorders + :id: comp__recorders + :security: YES + :safety: ASIL_B + :status: invalid + :consists_of: comp__data_router_recorder, comp__file_recorder + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_component(need(), needs) }} + +.. + TEMPLATE: Uncomment and fill out the following comp_arc_sta directive: + + .. comp_arc_sta:: recorders (Static View) + :id: comp_arc_sta__recorders__static_view + :security: YES + :safety: ASIL_B + :status: invalid + :fulfils: comp_req__component_name__some_title + :includes: comp_arc_sta__component_name__2 + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_component(need(), needs) }} + +Dynamic Architecture +-------------------- + +.. + TEMPLATE: Uncomment and customize the comp_arc_dyn directive: + + .. comp_arc_dyn:: Dynamic View + :id: comp_arc_dyn__component_name__dynamic_view + :security: YES + :safety: ASIL_B + :status: invalid + :fulfils: comp_req__component_name__some_title + + Put here a sequence diagram + + +Interfaces +---------- + + +Internal Components +------------------- + +.. + TEMPLATE: Uncomment and customize the comp_arc_sta directive: + + .. comp_arc_sta:: Component Name Static View + :id: comp_arc_sta__component_name__2 + :status: invalid + :safety: ASIL_B + :security: YES + :fulfils: comp_req__component_name__some_title + :implements: logic_arc_int__feature_name__interface_name1 + + No architecture but detailed design + +.. note:: + Architecture can be split into multiple files. At component level the public interfaces to be used by the user and tester to be shown. + +.. attention:: + The above directives must be updated according to your component architecture. + + - Replace the example content by the real content (according to :need:`gd_guidl__arch_design`) + - Set the status to valid and start the review/merge process diff --git a/docs/recorders/docs/index.rst b/docs/recorders/docs/index.rst new file mode 100644 index 0000000..4a31025 --- /dev/null +++ b/docs/recorders/docs/index.rst @@ -0,0 +1,173 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_recorders: + +recorders +######### + +.. note:: Document header + +.. document:: recorders + :id: doc__recorders + :status: draft + :safety: ASIL_B + :security: NO + :realizes: wp__cmpt_request + :tags: template + +.. attention:: + The above directive must be updated according to your Component. + + - Modify ``document`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Abstract +======== + +[A short (~200 word) description of the contribution being addressed.] + + +Motivation +========== + +[Clearly explain why the existing platform/project solution is inadequate to address the topic that the CR solves.] + +.. note:: + The motivation is critical for CRs that want to change the existing components. + It should clearly explain why the existing solution is inadequate to address the topic that the CR solves. + Motivation may based on criteria as resource requirements, scheduling issues, risks, benefits, etc. + CRs submissions without sufficient motivation may be rejected. + + + +Rationale +========= + +[Describe why particular design decisions were made.] + +.. note:: + The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion. + For the documentation of the decision the :need:`gd_temp__change_decision_record` can be used. + +Specification +============= + +[Describe the requirements, architecture of any new component.] or +[Describe the change to requirements, architecture, implementation, documentation of any change request.] + +.. note:: + A CR shall specify the component requirements as part of our platform/project. + Thereby the :need:`rl__project_lead` will approve these requirements as part of accepting the CR (e.g. merging the PR with the CR). + + +Backwards Compatibility +======================= + +[Describe potential impact (especially including safety and security impacts) and severity on pre-existing platform/project elements.] + + +Security Impact +=============== + +[How could a malicious user take advantage of this new/modified component?] + +.. note:: + If there are security concerns in relation to the CR, those concerns should be explicitly written out to make sure reviewers of the CR are aware of them. + +Which security requirements are affected or has to be changed? +Could the new/modified component enable new threat scenarios? +Could the new/modified component enable new attack paths? +Could the new/modified component impact functional safety? +If applicable, which additional security measures must be implemented to mitigate the risk? + +.. note:: + Use Security Software Critically Analysis, Vulnerability Analysis. + [Methods will be defined later in Process area Security Analysis] + + +Safety Impact +============= + +[How could the safety be impacted by the new/modified component?] + +.. note:: + If there are safety concerns in relation to the CR, those concerns should be explicitly written out to make sure reviewers of the CR are aware of them. + +Which safety requirements are affected or has to be changed? +Could the new/modified component be a potential common cause or cascading failure initiator? +If applicable, which additional safety measures must be implemented to mitigate the risk? + +.. note:: + Use Dependency Failure Analysis and/or Safety Software Critically Analysis. + [Methods will be defined later in Process area Safety Analysis] + +For new feature/component contributions: + +[What is the expected ASIL level?] +[What is the expected classification of the contribution?] + +.. note:: + Use the component classification method here to classify your component, if it shall to be used in a safety context: :need:`gd_temp__component_classification`. + +License Impact +============== + +[How could the copyright impacted by the license of the new contribution?] + + +How to Teach This +================= + +[How to teach users, new and experienced, how to apply the CR to their work.] + +.. note:: + For a CR that adds new functionality or changes behavior, it is helpful to include a section on how to teach users, new and experienced, how to apply the CR to their work. + +Rejected Ideas +============== + +[Why certain ideas that were brought while discussing this CR were not ultimately pursued.] + +.. note:: + Throughout the discussion of a CR, various ideas will be proposed which are not accepted. + Those rejected ideas should be recorded along with the reasoning as to why they were rejected. + This both helps record the thought process behind the final version of the CR as well as preventing people from bringing up the same rejected idea again in subsequent discussions. + In a way this section can be thought of as a breakout section of the Rationale section that is focused specifically on why certain ideas were not ultimately pursued. + + + +Open Issues +=========== + +[Any points that are still being decided/discussed.] + +.. note:: + While a CR is in draft, ideas can come up which warrant further discussion. + Those ideas should be recorded so people know that they are being thought about but do not have a concrete resolution. + This helps make sure all issues required for the CR to be ready for consideration are complete and reduces people duplicating prior discussion. + + + +Footnotes +========= + +[A collection of footnotes cited in the CR, and a place to list non-inline hyperlink targets.] + +.. toctree:: + :hidden: + + architecture/index.rst diff --git a/score/datarouter/test/ut/ut_logging/test_logparser.cpp b/score/datarouter/test/ut/ut_logging/test_logparser.cpp index 1f86258..dc7edc8 100644 --- a/score/datarouter/test/ut/ut_logging/test_logparser.cpp +++ b/score/datarouter/test/ut/ut_logging/test_logparser.cpp @@ -70,7 +70,7 @@ template <typename S, typename T> std::string make_message(S typeIndex, const T& t) { static constexpr msgsize_t MaxMessageSize = 65500; - std::array<char, MaxMessageSize> buffer{}; + std::array<char, MaxMessageSize> buffer; using s = ::score::common::visitor::logging_serializer; const auto indexSize = s::serialize(typeIndex, buffer.data(), buffer.size()); const auto size = indexSize + s::serialize(t, buffer.data() + indexSize, buffer.size() - indexSize); diff --git a/score/mw/log/rust/score_log_bridge/BUILD b/score/mw/log/rust/score_log_bridge/BUILD index 45c6f1b..31523e1 100644 --- a/score/mw/log/rust/score_log_bridge/BUILD +++ b/score/mw/log/rust/score_log_bridge/BUILD @@ -30,14 +30,6 @@ config_setting( ], ) -config_setting( - name = "x86_64-qnx", - constraint_values = [ - "@platforms//cpu:x86_64", - "@platforms//os:qnx", - ], -) - cc_library( name = "adapter", srcs = ["src/adapter.cpp"], @@ -45,7 +37,6 @@ cc_library( defines = select({ ":x86_64-linux": ["x86_64_linux"], ":arm64-qnx": ["arm64_qnx"], - ":x86_64-qnx": ["x86_64_qnx"], "//conditions:default": [], }), visibility = ["//visibility:private"], @@ -62,7 +53,6 @@ rust_library( crate_features = select({ ":x86_64-linux": ["x86_64_linux"], ":arm64-qnx": ["arm64_qnx"], - ":x86_64-qnx": ["x86_64_qnx"], "//conditions:default": [], }), edition = "2021", diff --git a/score/mw/log/rust/score_log_bridge/examples/main.rs b/score/mw/log/rust/score_log_bridge/examples/main.rs index bd96a25..8c1c928 100644 --- a/score/mw/log/rust/score_log_bridge/examples/main.rs +++ b/score/mw/log/rust/score_log_bridge/examples/main.rs @@ -12,7 +12,7 @@ // use score_log::{debug, error, fatal, info, trace, warn, Log}; -use score_log_bridge::ScoreLogBridgeBuilder; +use score_log_bridge::ScoreLoggerBuilder; use std::path::PathBuf; fn main() { @@ -24,8 +24,8 @@ fn main() { .join("config") .join("logging.json"); - // Initialize `ScoreLogBridge` as a default logger. - ScoreLogBridgeBuilder::new() + // Initialize `ScoreLogger` as a default logger. + ScoreLoggerBuilder::new() .show_module(false) .show_file(true) .show_line(false) @@ -59,7 +59,7 @@ fn main() { ); // Use logger instance with modified context. - let logger = ScoreLogBridgeBuilder::new() + let logger = ScoreLoggerBuilder::new() .context("ALFA") .show_module(false) .show_file(true) diff --git a/score/mw/log/rust/score_log_bridge/src/adapter.cpp b/score/mw/log/rust/score_log_bridge/src/adapter.cpp index f46e4a0..30e01a8 100644 --- a/score/mw/log/rust/score_log_bridge/src/adapter.cpp +++ b/score/mw/log/rust/score_log_bridge/src/adapter.cpp @@ -23,7 +23,7 @@ using namespace score::mw::log::detail; // Those parameters must be: // - managed by build system (using defines and features) // - cross-checked between `ffi.rs` and `adapter.cpp` -#if defined(x86_64_linux) || defined(arm64_qnx) || defined(x86_64_qnx) +#if defined(x86_64_linux) || defined(arm64_qnx) // Expected size and alignment of `SlotHandle`. static_assert(sizeof(SlotHandle) == 24); static_assert(alignof(SlotHandle) == 8); diff --git a/score/mw/log/rust/score_log_bridge/src/ffi.rs b/score/mw/log/rust/score_log_bridge/src/ffi.rs index 6bef1da..a896d89 100644 --- a/score/mw/log/rust/score_log_bridge/src/ffi.rs +++ b/score/mw/log/rust/score_log_bridge/src/ffi.rs @@ -181,15 +181,12 @@ unsafe impl Sync for Recorder {} /// Those parameters must be: /// - managed by build system (using defines and features) /// - cross-checked between `ffi.rs` and `adapter.cpp` -#[cfg(any(feature = "x86_64_linux", feature = "arm64_qnx", feature = "x86_64_qnx"))] +#[cfg(any(feature = "x86_64_linux", feature = "arm64_qnx"))] #[repr(C, align(8))] pub struct SlotHandleStorage { _private: [u8; 24], } -#[cfg(not(any(feature = "x86_64_linux", feature = "arm64_qnx", feature = "x86_64_qnx")))] -compile_error!("Unknown configuration, unable to check layout"); - impl SlotHandleStorage { /// Returns an unsafe mutable pointer to this object. pub fn as_mut_ptr(&mut self) -> *mut SlotHandleStorage { diff --git a/score/mw/log/rust/score_log_bridge/src/lib.rs b/score/mw/log/rust/score_log_bridge/src/lib.rs index 553a421..0dfd5cc 100644 --- a/score/mw/log/rust/score_log_bridge/src/lib.rs +++ b/score/mw/log/rust/score_log_bridge/src/lib.rs @@ -18,6 +18,6 @@ #![warn(clippy::alloc_instead_of_core)] mod ffi; -mod score_log_bridge; +mod score_logger; -pub use crate::score_log_bridge::{ScoreLogBridge, ScoreLogBridgeBuilder}; +pub use crate::score_logger::{ScoreLogger, ScoreLoggerBuilder}; diff --git a/score/mw/log/rust/score_log_bridge/src/score_log_bridge.rs b/score/mw/log/rust/score_log_bridge/src/score_logger.rs similarity index 89% rename from score/mw/log/rust/score_log_bridge/src/score_log_bridge.rs rename to score/mw/log/rust/score_log_bridge/src/score_logger.rs index 4ee0a41..9b4e3af 100644 --- a/score/mw/log/rust/score_log_bridge/src/score_log_bridge.rs +++ b/score/mw/log/rust/score_log_bridge/src/score_logger.rs @@ -19,8 +19,8 @@ use score_log::{Log, Metadata, Record}; use std::env::{set_var, var_os}; use std::path::PathBuf; -/// Builder for the [`ScoreLogBridge`]. -pub struct ScoreLogBridgeBuilder { +/// Builder for the [`ScoreLogger`]. +pub struct ScoreLoggerBuilder { context: Context, show_module: bool, show_file: bool, @@ -28,7 +28,7 @@ pub struct ScoreLogBridgeBuilder { config_path: Option<PathBuf>, } -impl ScoreLogBridgeBuilder { +impl ScoreLoggerBuilder { /// Create builder with default parameters. /// /// # Panics @@ -39,7 +39,7 @@ impl ScoreLogBridgeBuilder { Self::default() } - /// Set context for the [`ScoreLogBridge`]. + /// Set context for the [`ScoreLogger`]. /// /// Only ASCII characters are allowed. /// Max 4 characters are used. Rest of the provided string will be trimmed. @@ -77,10 +77,10 @@ impl ScoreLogBridgeBuilder { self } - /// Build the [`ScoreLogBridge`] with provided context and configuration. - pub fn build(self) -> ScoreLogBridge { + /// Build the [`ScoreLogger`] with provided context and configuration. + pub fn build(self) -> ScoreLogger { let recorder = Recorder::new(); - ScoreLogBridge { + ScoreLogger { context: self.context, show_module: self.show_module, show_file: self.show_file, @@ -89,7 +89,7 @@ impl ScoreLogBridgeBuilder { } } - /// Build the [`ScoreLogBridge`] and set it as the default logger. + /// Build the [`ScoreLogger`] and set it as the default logger. /// /// # Safety /// @@ -126,7 +126,7 @@ impl ScoreLogBridgeBuilder { } } -impl Default for ScoreLogBridgeBuilder { +impl Default for ScoreLoggerBuilder { /// Create builder with default parameters. /// /// # Panics @@ -154,7 +154,7 @@ impl Default for ScoreLogBridgeBuilder { } /// C++-based logger implementation. -pub struct ScoreLogBridge { +pub struct ScoreLogger { context: Context, show_module: bool, show_file: bool, @@ -162,14 +162,14 @@ pub struct ScoreLogBridge { recorder: Recorder, } -impl ScoreLogBridge { +impl ScoreLogger { /// Current log level for provided context. pub(crate) fn log_level(&self, context: &Context) -> LogLevel { self.recorder.log_level(context) } } -impl Log for ScoreLogBridge { +impl Log for ScoreLogger { fn enabled(&self, metadata: &Metadata) -> bool { let context = Context::from(metadata.context()); self.log_level(&context) >= metadata.level().into() @@ -222,13 +222,13 @@ impl Log for ScoreLogBridge { #[cfg(test)] mod tests { - use crate::ScoreLogBridgeBuilder; + use crate::ScoreLoggerBuilder; use std::env::var_os; use std::path::PathBuf; #[test] fn test_builder_new() { - let builder = ScoreLogBridgeBuilder::new(); + let builder = ScoreLoggerBuilder::new(); assert_eq!(builder.context, "DFLT".into()); assert!(!builder.show_module); assert!(!builder.show_file); @@ -238,7 +238,7 @@ mod tests { #[test] fn test_builder_default() { - let builder = ScoreLogBridgeBuilder::default(); + let builder = ScoreLoggerBuilder::default(); assert_eq!(builder.context, "DFLT".into()); assert!(!builder.show_module); assert!(!builder.show_file); @@ -248,7 +248,7 @@ mod tests { #[test] fn test_builder_context() { - let builder = ScoreLogBridgeBuilder::new().context("NEW_CONTEXT"); + let builder = ScoreLoggerBuilder::new().context("NEW_CONTEXT"); assert_eq!(builder.context, "NEW_CONTEXT".into()); assert!(!builder.show_module); assert!(!builder.show_file); @@ -258,7 +258,7 @@ mod tests { #[test] fn test_builder_show_module() { - let builder = ScoreLogBridgeBuilder::new().show_module(true); + let builder = ScoreLoggerBuilder::new().show_module(true); assert_eq!(builder.context, "DFLT".into()); assert!(builder.show_module); assert!(!builder.show_file); @@ -268,7 +268,7 @@ mod tests { #[test] fn test_builder_show_file() { - let builder = ScoreLogBridgeBuilder::new().show_file(true); + let builder = ScoreLoggerBuilder::new().show_file(true); assert_eq!(builder.context, "DFLT".into()); assert!(!builder.show_module); assert!(builder.show_file); @@ -278,7 +278,7 @@ mod tests { #[test] fn test_builder_show_line() { - let builder = ScoreLogBridgeBuilder::new().show_line(true); + let builder = ScoreLoggerBuilder::new().show_line(true); assert_eq!(builder.context, "DFLT".into()); assert!(!builder.show_module); assert!(!builder.show_file); @@ -288,7 +288,7 @@ mod tests { #[test] fn test_builder_config_path() { - let builder = ScoreLogBridgeBuilder::new().config(PathBuf::from("/some/path")); + let builder = ScoreLoggerBuilder::new().config(PathBuf::from("/some/path")); assert_eq!(builder.context, "DFLT".into()); assert!(!builder.show_module); assert!(!builder.show_file); @@ -298,7 +298,7 @@ mod tests { #[test] fn test_builder_chained() { - let builder = ScoreLogBridgeBuilder::new() + let builder = ScoreLoggerBuilder::new() .context("NEW_CONTEXT") .show_module(true) .show_file(true) @@ -313,7 +313,7 @@ mod tests { #[test] fn test_builder_build() { - let logger = ScoreLogBridgeBuilder::new() + let logger = ScoreLoggerBuilder::new() .context("NEW_CONTEXT") .show_module(true) .show_file(true) @@ -332,7 +332,7 @@ mod tests { assert!(var_os(KEY).is_none()); let config_path = PathBuf::from("/some/path"); - ScoreLogBridgeBuilder::new() + ScoreLoggerBuilder::new() .context("NEW_CONTEXT") .show_module(true) .show_file(true) diff --git a/score/mw/log/rust/score_log_bridge_cpp_init/BUILD b/score/mw/log/rust/score_log_bridge_cpp_init/BUILD deleted file mode 100644 index 99a9549..0000000 --- a/score/mw/log/rust/score_log_bridge_cpp_init/BUILD +++ /dev/null @@ -1,67 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2025 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# -# SPDX-License-Identifier: Apache-2.0 -# ******************************************************************************* - -load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") -load("@rules_rust//rust:defs.bzl", "rust_static_library") - -rust_static_library( - name = "ffi", - srcs = ["ffi.rs"], - edition = "2021", - visibility = ["//visibility:private"], - deps = [ - "//score/mw/log/rust/score_log_bridge", - ], -) - -cc_library( - name = "score_log_bridge_cpp_init", - srcs = ["score_log_bridge_init.cpp"], - hdrs = ["score_log_bridge_init.h"], - include_prefix = "score/mw/log/rust", - visibility = ["//visibility:public"], - deps = [ - ":ffi", - # Link dependency required by `:ffi`. - "//score/mw/log/detail/common:recorder_factory", - ], -) - -# Example consists of Rust library, C++ library, C++ application. - -rust_static_library( - name = "example_lib", - srcs = ["examples/example_lib.rs"], - edition = "2021", - visibility = ["//visibility:private"], - deps = [ - "//score/mw/log/rust/score_log_bridge", - "@score_baselibs_rust//src/log/score_log", - ], -) - -cc_binary( - name = "example", - srcs = ["examples/main.cpp"], - linkopts = select({ - "@platforms//os:qnx": [ - "-lsocket", - ], - "//conditions:default": [], - }), - visibility = ["//visibility:public"], - deps = [ - ":example_lib", - ":score_log_bridge_cpp_init", - ], -) diff --git a/score/mw/log/rust/score_log_bridge_cpp_init/examples/example_lib.rs b/score/mw/log/rust/score_log_bridge_cpp_init/examples/example_lib.rs deleted file mode 100644 index eb7be30..0000000 --- a/score/mw/log/rust/score_log_bridge_cpp_init/examples/example_lib.rs +++ /dev/null @@ -1,75 +0,0 @@ -// -// Copyright (c) 2025 Contributors to the Eclipse Foundation -// -// See the NOTICE file(s) distributed with this work for additional -// information regarding copyright ownership. -// -// This program and the accompanying materials are made available under the -// terms of the Apache License Version 2.0 which is available at -// <https://www.apache.org/licenses/LICENSE-2.0> -// -// SPDX-License-Identifier: Apache-2.0 -// - -//! Module contains functions printing example logs. -//! Based on `//score/mw/log/rust/score_log_bridge:example`. - -use score_log::{debug, error, fatal, info, trace, warn, Log}; -use score_log_bridge::ScoreLogBridgeBuilder; - -/// Show example logs. -#[no_mangle] -extern "C" fn show_logs() { - // Regular log usage. - trace!("This is a trace log - hidden"); - debug!("This is a debug log - hidden"); - info!("This is an info log"); - warn!("This is a warn log"); - error!("This is an error log"); - fatal!("This is a fatal log"); - - // Log with modified context. - trace!(context: "EX1", "This is a trace log - hidden"); - debug!(context: "EX1", "This is a debug log - hidden"); - info!(context: "EX1", "This is an info log"); - warn!(context: "EX1", "This is a warn log"); - error!(context: "EX1", "This is an error log"); - fatal!(context: "EX1", "This is a fatal log"); - - // Log with numeric values. - let x1 = 123.4; - let x2 = 111; - let x3 = true; - let x4 = -0x3Fi8; - error!( - "This is an error log with numeric values: {} {} {} {:x}", - x1, x2, x3, x4, - ); - - // Use logger instance with modified context. - let logger = ScoreLogBridgeBuilder::new() - .context("ALFA") - .show_module(false) - .show_file(true) - .show_line(false) - .build(); - - // Log with provided logger. - trace!( - logger: logger, - "This is a trace log - hidden" - ); - debug!(logger: logger, "This is a debug log - hidden"); - info!(logger: logger, "This is an info log"); - warn!(logger: logger, "This is a warn log"); - error!(logger: logger, "This is an error log"); - fatal!(logger: logger, "This is an fatal log"); - - // Log with provided logger and modified context. - trace!(logger: logger, context: "EX2", "This is a trace log - hidden"); - debug!(logger: logger, context: "EX2", "This is a debug log - hidden"); - info!(logger: logger, context: "EX2", "This is an info log"); - warn!(logger: logger, context: "EX2", "This is a warn log"); - error!(logger: logger, context: "EX2", "This is an error log"); - fatal!(logger: logger, context: "EX2", "This is an fatal log"); -} diff --git a/score/mw/log/rust/score_log_bridge_cpp_init/examples/main.cpp b/score/mw/log/rust/score_log_bridge_cpp_init/examples/main.cpp deleted file mode 100644 index 43ce02e..0000000 --- a/score/mw/log/rust/score_log_bridge_cpp_init/examples/main.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -#include "score/mw/log/rust/score_log_bridge_init.h" - -extern "C" { -void show_logs(); -} - -int main() -{ - using namespace score::mw::log::rust; - - ScoreLogBridgeBuilder builder; - builder.Context("ABCD").ShowModule(true).ShowFile(true).ShowLine(true).SetAsDefaultLogger(); - - show_logs(); - - return 0; -} diff --git a/score/mw/log/rust/score_log_bridge_cpp_init/ffi.rs b/score/mw/log/rust/score_log_bridge_cpp_init/ffi.rs deleted file mode 100644 index eb13677..0000000 --- a/score/mw/log/rust/score_log_bridge_cpp_init/ffi.rs +++ /dev/null @@ -1,50 +0,0 @@ -// -// Copyright (c) 2025 Contributors to the Eclipse Foundation -// -// See the NOTICE file(s) distributed with this work for additional -// information regarding copyright ownership. -// -// This program and the accompanying materials are made available under the -// terms of the Apache License Version 2.0 which is available at -// <https://www.apache.org/licenses/LICENSE-2.0> -// -// SPDX-License-Identifier: Apache-2.0 -// - -use core::ffi::c_char; -use core::slice::from_raw_parts; -use score_log_bridge::ScoreLogBridgeBuilder; - -#[no_mangle] -extern "C" fn set_default_logger( - context_ptr: *const c_char, - context_size: usize, - show_module: *const bool, - show_file: *const bool, - show_line: *const bool, -) { - let mut builder = ScoreLogBridgeBuilder::new(); - - // Set parameters if non-null (option-like). - if !context_ptr.is_null() { - let context = unsafe { - let slice = from_raw_parts(context_ptr.cast(), context_size); - str::from_utf8(slice).expect("provided context is not a valid UTF-8 string") - }; - builder = builder.context(context); - } - - if !show_module.is_null() { - builder = builder.show_module(unsafe { *show_module }); - } - - if !show_file.is_null() { - builder = builder.show_file(unsafe { *show_file }); - } - - if !show_line.is_null() { - builder = builder.show_line(unsafe { *show_line }); - } - - builder.set_as_default_logger(); -} diff --git a/score/mw/log/rust/score_log_bridge_cpp_init/score_log_bridge_init.cpp b/score/mw/log/rust/score_log_bridge_cpp_init/score_log_bridge_init.cpp deleted file mode 100644 index 598b34b..0000000 --- a/score/mw/log/rust/score_log_bridge_cpp_init/score_log_bridge_init.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -#include "score_log_bridge_init.h" - -extern "C" void set_default_logger(const char* context_ptr, - size_t context_size, - const bool* show_module, - const bool* show_file, - const bool* show_line); - -namespace score::mw::log::rust -{ - -ScoreLogBridgeBuilder& ScoreLogBridgeBuilder::Context(const std::string& context) noexcept -{ - context_ = context; - return *this; -} - -ScoreLogBridgeBuilder& ScoreLogBridgeBuilder::ShowModule(bool show_module) noexcept -{ - show_module_ = show_module; - return *this; -} - -ScoreLogBridgeBuilder& ScoreLogBridgeBuilder::ShowFile(bool show_file) noexcept -{ - show_file_ = show_file; - return *this; -} - -ScoreLogBridgeBuilder& ScoreLogBridgeBuilder::ShowLine(bool show_line) noexcept -{ - show_line_ = show_line; - return *this; -} - -void ScoreLogBridgeBuilder::SetAsDefaultLogger() noexcept -{ - const char* context_ptr{nullptr}; - size_t context_size{0}; - if (context_) - { - auto value{context_.value()}; - context_ptr = value.c_str(); - context_size = value.size(); - } - - const bool* show_module{show_module_ ? &show_module_.value() : nullptr}; - const bool* show_file{show_file_ ? &show_file_.value() : nullptr}; - const bool* show_line{show_line_ ? &show_line_.value() : nullptr}; - - set_default_logger(context_ptr, context_size, show_module, show_file, show_line); -} - -} // namespace score::mw::log::rust diff --git a/score/mw/log/rust/score_log_bridge_cpp_init/score_log_bridge_init.h b/score/mw/log/rust/score_log_bridge_cpp_init/score_log_bridge_init.h deleted file mode 100644 index 8df157d..0000000 --- a/score/mw/log/rust/score_log_bridge_cpp_init/score_log_bridge_init.h +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -#pragma once - -#include <optional> -#include <string> - -namespace score::mw::log::rust -{ - -/// @brief -/// Builder for logger used by Rust libraries. -/// -/// @note -/// If parameter is not set explicitly then Rust-side default is used. -/// Only global logger setup is allowed. -/// `config` method is not exposed. -class ScoreLogBridgeBuilder final -{ - public: - /// @brief Set context for the logger. - /// @param context - /// Context name. - /// Only ASCII characters are allowed. - /// Max 4 characters are used. Rest of the provided string will be trimmed. - /// @return This builder. - ScoreLogBridgeBuilder& Context(const std::string& context) noexcept; - - /// @brief Show module name in logs. - /// @param show_module Value to set. - /// @return This builder. - ScoreLogBridgeBuilder& ShowModule(bool show_module) noexcept; - - /// @brief Show file name in logs. - /// @param show_module Value to set. - /// @return This builder. - ScoreLogBridgeBuilder& ShowFile(bool show_file) noexcept; - - /// @brief Show line number in logs. - /// @param show_module Value to set. - /// @return This builder. - ScoreLogBridgeBuilder& ShowLine(bool show_line) noexcept; - - /// @brief Initialize default logger with provided parameters. - void SetAsDefaultLogger() noexcept; - - private: - std::optional<std::string> context_; - std::optional<bool> show_module_; - std::optional<bool> show_file_; - std::optional<bool> show_line_; -}; - -} // namespace score::mw::log::rust From 4fd90600184b604579bae931f2fc54b136d94aa1 Mon Sep 17 00:00:00 2001 From: arsibo <arvid.sievert@etas.com> Date: Mon, 2 Feb 2026 07:56:42 +0000 Subject: [PATCH 2/5] build: Replace local_path_override with git_override for POC branch dependencies POC for https://github.com/eclipse-score/score/pull/2346 Replace local path overrides with git overrides using branch arsibo_dr_005_poc for: - score_docs_as_code - score_platform - score_baselibs - score_baselibs_rust This allows the build to work with remote branches after pushing. --- MODULE.bazel | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 4d571af..e16c846 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -28,18 +28,20 @@ bazel_dep(name = "platforms", version = "1.0.0") # S-CORE process rules bazel_dep(name = "score_bazel_platforms", version = "0.0.3") bazel_dep(name = "score_docs_as_code", version = "2.2.0") -local_path_override( +git_override( module_name = "score_docs_as_code", - path = "/workspaces/arsibo_dr_005_poc_20260130/score_docs-as-code", + remote = "https://github.com/etas-contrib/score_docs-as-code.git", + branch = "arsibo_dr_005_poc", ) bazel_dep(name = "score_tooling", version = "1.0.4") bazel_dep(name = "score_rust_policies", version = "0.0.3") bazel_dep(name = "score_process", version = "1.4.0", dev_dependency = True) bazel_dep(name = "score_platform", version = "0.5.1", dev_dependency = True) -local_path_override( +git_override( module_name = "score_platform", - path = "/workspaces/arsibo_dr_005_poc_20260130/score_score", + remote = "https://github.com/etas-contrib/score_score.git", + branch = "arsibo_dr_005_poc", ) # Toolchains and extensions @@ -109,15 +111,17 @@ bazel_dep(name = "rapidjson", version = "1.1.0") # ) bazel_dep(name = "score_baselibs", version = "0.2.0") -local_path_override( +git_override( module_name = "score_baselibs", - path = "/workspaces/arsibo_dr_005_poc_20260130/score_baselibs", + remote = "https://github.com/etas-contrib/score_baselibs.git", + branch = "arsibo_dr_005_poc", ) # Rust dependencies bazel_dep(name = "score_baselibs_rust", version = "0.0.3") -local_path_override( +git_override( module_name = "score_baselibs_rust", - path = "/workspaces/arsibo_dr_005_poc_20260130/score_baselibs_rust", + remote = "https://github.com/etas-contrib/score_baselibs_rust.git", + branch = "arsibo_dr_005_poc", ) From 7b42d0748afb7db594093dc985ed485c89efe46a Mon Sep 17 00:00:00 2001 From: arsibo <arvid.sievert@etas.com> Date: Mon, 2 Feb 2026 10:36:46 +0000 Subject: [PATCH 3/5] docs: Update component architecture implementation details for data_router_recorder --- docs/data_router_recorder/docs/architecture/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/data_router_recorder/docs/architecture/index.rst b/docs/data_router_recorder/docs/architecture/index.rst index f08f655..67752e5 100644 --- a/docs/data_router_recorder/docs/architecture/index.rst +++ b/docs/data_router_recorder/docs/architecture/index.rst @@ -75,7 +75,7 @@ The components are designed to cover the expectations from the feature architect :security: YES :safety: ASIL_B :status: invalid - :implements: logic_arc_int__log_cpp__recorder, logic_arc_int__logging__buffer, + :implements: logic_arc_int__log_cpp__recorder, logic_arc_int__logging__buffer .. needarch:: :scale: 50 From 96f9adf310048ac695071d288b4415952fe52cae Mon Sep 17 00:00:00 2001 From: arsibo <arvid.sievert@etas.com> Date: Mon, 2 Feb 2026 10:47:03 +0000 Subject: [PATCH 4/5] chore: Replace local_path_overrides with git_overrides for score_platform and score_docs_as_code --- MODULE.bazel | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index e16c846..c6342d3 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -30,8 +30,8 @@ bazel_dep(name = "score_bazel_platforms", version = "0.0.3") bazel_dep(name = "score_docs_as_code", version = "2.2.0") git_override( module_name = "score_docs_as_code", - remote = "https://github.com/etas-contrib/score_docs-as-code.git", - branch = "arsibo_dr_005_poc", + commit = "1e0c4f5a52fbb327ec2929da00d51b080fcf6f10", + remote = "https://github.com/eclipse-score/docs-as-code.git", ) bazel_dep(name = "score_tooling", version = "1.0.4") bazel_dep(name = "score_rust_policies", version = "0.0.3") @@ -40,8 +40,8 @@ bazel_dep(name = "score_process", version = "1.4.0", dev_dependency = True) bazel_dep(name = "score_platform", version = "0.5.1", dev_dependency = True) git_override( module_name = "score_platform", - remote = "https://github.com/etas-contrib/score_score.git", - branch = "arsibo_dr_005_poc", + commit = "6829d691dfd4521ce376e22400bb104197967b7c", + remote = "https://github.com/eclipse-score/score.git", ) # Toolchains and extensions @@ -111,17 +111,15 @@ bazel_dep(name = "rapidjson", version = "1.1.0") # ) bazel_dep(name = "score_baselibs", version = "0.2.0") -git_override( +local_path_override( module_name = "score_baselibs", - remote = "https://github.com/etas-contrib/score_baselibs.git", - branch = "arsibo_dr_005_poc", + path = "../score_baselibs", ) # Rust dependencies bazel_dep(name = "score_baselibs_rust", version = "0.0.3") -git_override( +local_path_override( module_name = "score_baselibs_rust", - remote = "https://github.com/etas-contrib/score_baselibs_rust.git", - branch = "arsibo_dr_005_poc", + path = "../score_baselibs_rust", ) From d21f463ffa4b12b141cc3b4a7f0ad3f00cc4c980 Mon Sep 17 00:00:00 2001 From: arsibo <arvid.sievert@etas.com> Date: Mon, 2 Feb 2026 10:51:47 +0000 Subject: [PATCH 5/5] chore: Replace local_path_overrides with git_overrides for score_baselibs and score_baselibs_rust --- MODULE.bazel | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index c6342d3..ef25a27 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -31,7 +31,7 @@ bazel_dep(name = "score_docs_as_code", version = "2.2.0") git_override( module_name = "score_docs_as_code", commit = "1e0c4f5a52fbb327ec2929da00d51b080fcf6f10", - remote = "https://github.com/eclipse-score/docs-as-code.git", + remote = "https://github.com/etas-contrib/score_docs-as-code.git", ) bazel_dep(name = "score_tooling", version = "1.0.4") bazel_dep(name = "score_rust_policies", version = "0.0.3") @@ -41,7 +41,7 @@ bazel_dep(name = "score_platform", version = "0.5.1", dev_dependency = True) git_override( module_name = "score_platform", commit = "6829d691dfd4521ce376e22400bb104197967b7c", - remote = "https://github.com/eclipse-score/score.git", + remote = "https://github.com/etas-contrib/score_score.git", ) # Toolchains and extensions @@ -111,15 +111,17 @@ bazel_dep(name = "rapidjson", version = "1.1.0") # ) bazel_dep(name = "score_baselibs", version = "0.2.0") -local_path_override( +git_override( module_name = "score_baselibs", - path = "../score_baselibs", + commit = "458dbd6ef269326405006222c68dc9146be119b6", + remote = "https://github.com/etas-contrib/score_baselibs.git", ) # Rust dependencies bazel_dep(name = "score_baselibs_rust", version = "0.0.3") -local_path_override( +git_override( module_name = "score_baselibs_rust", - path = "../score_baselibs_rust", + commit = "70ff0888f8c5f5286c9134752f4dae9dc50b888c", + remote = "https://github.com/etas-contrib/score_baselibs_rust.git", )