+
Skip to content

Conversation

arsibo
Copy link
Contributor

@arsibo arsibo commented Jan 22, 2025

initial version of feature request #68

@arsibo arsibo changed the title Initial version of logging Feature Request initial version of logging feature request Jan 22, 2025
@arsibo arsibo force-pushed the arsibo_FR_logging branch from 30e0936 to 3d6a578 Compare January 23, 2025 08:41
@AlexanderLanin
Copy link
Member

@rmaddikery
Copy link

We will try to bring our comments #68 (comment) here..

Logging has to support the following features:
- Timestamping
- Log/serverity levels
- Log priorisation in case of ressource conflicts
Copy link
Contributor

Choose a reason for hiding this comment

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

Let us detail out what the actual use case is. When will prioritization be needed. What kind of resource conflicts are considered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

later clarification

Log Sources
-----------

- raw sensor data e.g. video streams
Copy link
Contributor

Choose a reason for hiding this comment

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

With something as large as a video stream - is this really logging, or rather data recording? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

E.g. how does this match line 86:

Logs shall appear on stdout when running unit tests

I rather agree with a definition of logging as small status messages from running applications, which can be shown on stdout or sent to another sink. But raw sensor data sounds rather like data recording to me than logging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my opinion "- raw sensor data e.g. video streams" belongs to replay.
source https://eclipse-score.github.io/score/requirements/stakeholder/index.html#STKH_REQ__290
STKH correction needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

STKH will be corrected (split in two)

Comment on lines 117 to 147
- Runtime ressources
- Low impact on overall performance ---> QoS for handling overflows/dropping log messages
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Design decision for detailed design => copy there

-------

- Supported operating system: QNX, Linux (encapsulation via OSAL)
- Supported programming languages: C++, Rust, Python (e.g. for tests)
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Design decision for detailed design => copy there

Choose a reason for hiding this comment

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

Python comes with logging out of the box and the concepts are similar to Rust, where you can add custom 'handlers'.
C++ doesn't really have such a standardized interface. There are libraries like log4cplus or spdlog or even boost logging which are all more or less common. But nothing as standardized as with the other two.

@simon-acc
Copy link
Contributor

Thank you for the suggestion @arsibo ! In general, I can recommend this typo checked which works incredibly fast even on large codebases (and also typo-checks variable names etc.):

https://github.com/crate-ci/typos?tab=readme-ov-file#typos

~/workspace/eclipse-score/score/docs/features/analysis-infra> typos logging
error: `availible` should be `available`
  --> logging/mw-fr_logging.rst:41:25
   |
41 | - currently no solution availible in the score platform
   |                         ^^^^^^^^^
   |
error: `ressource` should be `resource`
  --> logging/mw-fr_logging.rst:64:31
   |
64 | - Log priorisation in case of ressource conflicts
   |                               ^^^^^^^^^
   |
error: `Ressource` should be `Resource`
  --> logging/mw-fr_logging.rst:112:1
    |
112 | Ressource consumtion
    | ^^^^^^^^^
    |
error: `consumtion` should be `consumption`
  --> logging/mw-fr_logging.rst:112:11
    |
112 | Ressource consumtion
    |           ^^^^^^^^^^
    |
error: `ressources` should be `resources`
  --> logging/mw-fr_logging.rst:117:11
    |
117 | - Runtime ressources
    |           ^^^^^^^^^^
    |
error: `informations` should be `information`
  --> logging/mw-fr_logging.rst:138:41
    |
138 |   That could be the case if the logging informations are part of the verification strategy..


Norms/Standards
---------------

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@arsibo arsibo Feb 4, 2025

Choose a reason for hiding this comment

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

  • check for IP
  • compatibility to DLT has to be add

- Log priorisation in case of ressource conflicts
- logging of early startup envents
- log filtering
- message loss detection
Copy link
Contributor

Choose a reason for hiding this comment

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

Message loss detection use cases:

  • discarded log messages in case of internal buffer full
  • lost messages detection based on global message counter (e.g. MCNT from DLT protocol)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hint: prio logic needs to define late

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall have low impact on overall system performance and provide QoS for handling overflows or dropping log messages.
Copy link
Contributor

Choose a reason for hiding this comment

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

split needed for atomic Reqs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall be compatible with the Diagnostic Log and Trace (DLT) protocol, including support for DLT message format, sending and receiving DLT messages, and integration with existing DLT tools and infrastructure.
Copy link
Contributor

Choose a reason for hiding this comment

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

DLT can be added in some Abbreviations section and what DLT compatible means can be part of a separate Req attribute e.g., Additional Info = support for DLT message format, sending and receiving DLT messages, and integration with existing DLT tools, infrastructure...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall be compatible with the Diagnostic Log and Trace (DLT) protocol, including support for DLT message format, sending and receiving DLT messages, and integration with existing DLT tools and infrastructure.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The logging framework shall be compatible with the Diagnostic Log and Trace (DLT) protocol, including support for DLT message format, sending and receiving DLT messages, and integration with existing DLT tools and infrastructure.
The logging framework shall be DLT compatible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

arsibo added 5 commits May 14, 2025 07:54
- Update the requirement with the review findings.
-  Add a glossary.
-  Remove tracing FR.
- Update the requirement with the review findings.
-  Add a glossary.
-  Remove tracing FR.
- Update the requirement with the review findings.
-  Add a glossary.
-  Remove tracing FR.
- Update the requirement with the review findings.
-  Add a glossary.
-  Remove tracing FR.
- Update the requirement with the review findings.
-  Add a glossary.
-  Remove tracing FR.

Glossary
########
- DLT - Diagnostic Log and Trace
Copy link
Member

@4og 4og May 14, 2025

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
We need to discuss if the link in the requirement text to the glossary can lead to problems when exporting to other requirement tools.

Comment on lines 21 to 26
.. .. gd_temp:: Feature Requirements Templates
.. :id: gd_temp__log_req_feat_req
.. :status: valid
.. :complies: std_wp__iso26262__software_651, std_req__iso26262__support_641, std_req__iso26262__support_6421, std_req__iso26262__support_6425

.. .. code-block:: rst
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall ensure logs appear on stdout when running unit tests.
Copy link
Member

Choose a reason for hiding this comment

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

Logging to stdout can be useful not only for the tests. Maybe unit tests can be mentioned here as an example.

Suggested change
The logging framework shall ensure logs appear on stdout when running unit tests.
The logging framework shall support stdout as log sink, e.g. when running unit tests.

The req title needs to be adapted accordingly.

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall support QNX and Linux operating systems (encapsulated via OSAL).
Copy link
Member

Choose a reason for hiding this comment

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

The OSAL implementation for C++ is available at https://github.com/eclipse-score/baselibs/tree/main/score/os It's a dependency for mw::log and mw::com
AFAIK there is currently no clear consensus within the S-CORE Architecture Community regarding the future direction of OSAL and the specific content it should include.

:reqtype: Interface
:security: NO
:safety: QM
:satisfies: stkh_req__dev_experience__logging_support
Copy link
Member

Choose a reason for hiding this comment

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

This also fits to stkh_req__dev_experience__prog_languages

Suggested change
:satisfies: stkh_req__dev_experience__logging_support
:satisfies: stkh_req__dev_experience__logging_support, stkh_req__dev_experience__prog_languages

:reqtype: Interface
:security: NO
:safety: QM
:satisfies: stkh_req__dev_experience__logging_support
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
:satisfies: stkh_req__dev_experience__logging_support
:satisfies: stkh_req__dev_experience__logging_support, stkh_req__overall_goals__enable_cooperation

:reqtype: Non-Functional
:security: YES
:safety: QM
:satisfies: stkh_req__dev_experience__logging_support
Copy link
Member

Choose a reason for hiding this comment

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

Does this req also fulfil stkh_req__dependability__security_features?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I add the req due to Mandatory access control

@@ -0,0 +1,25 @@
..
# *******************************************************************************
# Copyright (c) 2024 Contributors to the Eclipse Foundation
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Copyright (c) 2024 Contributors to the Eclipse Foundation
# Copyright (c) 2025 Contributors to the Eclipse Foundation

Same for other files

########
- DLT - Diagnostic Log and Trace
- Framework - 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.
- Logging nodes -
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Logging nodes -
- Logging node - ECU or Partition (real or virtual) which generates log messages

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

- Logging nodes -
- Platform -
- Component -
- Logging severity level - e.g., FATAL, ERROR, WARN, INFO, DEBUG, VERBOSE such as in DLT
Copy link
Contributor

@palexuc palexuc May 14, 2025

Choose a reason for hiding this comment

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

Suggested change
- Logging severity level - e.g., FATAL, ERROR, WARN, INFO, DEBUG, VERBOSE such as in DLT
- Log level - 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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall support log severity levels to categorize logs based on their importance.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The logging framework shall support log severity levels to categorize logs based on their importance.
The logging framework shall support a log level for each log entry.

Copy link
Contributor

@palexuc palexuc May 14, 2025

Choose a reason for hiding this comment

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

where log level for is defined in glossary, with examples (see above)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall support logging of early startup events to capture critical initialization information.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that indeed a Logging Req, or more a Tracing Req (i.e. be able to capture early startup events and forward/route them as log messages) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is part of the complete logging. But I'm not sure whether the responsibility for this lies with a logging component outside the S-Core scope.

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall support filtering by log levels (e.g., FATAL, ERROR, WARN, INFO, DEBUG, VERBOSE such as in DLT).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The logging framework shall support filtering by log levels (e.g., FATAL, ERROR, WARN, INFO, DEBUG, VERBOSE such as in DLT).
The logging framework shall support filtering by log levels.

Copy link
Contributor

Choose a reason for hiding this comment

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

(e.g., FATAL, ERROR, WARN, INFO, DEBUG, VERBOSE such as in DLT) is already in log level definition from the Glossary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall support user applications as log sources.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The logging framework shall support user applications as log sources.
The logging framework shall support user application as log source.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


- 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..
Copy link
Contributor

Choose a reason for hiding this comment

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

I strongly suggest that for S-CORE we define what we do:

  • either feature development supporting ASIL B
  • or write an AoU that logging is not allowed to be used for safety functionality plus implement measures to support FFI (i.e. logging does not interfere with memory and also does not block too much runtime of the applications which uses it).

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall support on-demand functionality, such as enabling or disabling log storage.
Copy link
Contributor

Choose a reason for hiding this comment

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

better to have one Req per supported on-demand functionality

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall provide fallback configurations, such as application-wide or system-wide defaults.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The logging framework shall provide fallback configurations, such as application-wide or system-wide defaults.
The logging framework shall allow to restore default configurations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are two different requirements.

  1. fallback => in the event that no specific configuration is available, use the default config
  2. restore=> active call to restore the default config

The original requirement addresses the fallback case.

Should I include the restore case in a new requirement?

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall continue operation in case of recoverable errors.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The logging framework shall continue operation in case of recoverable errors.
In case of recoverable error, the logging framework shall continue the current operations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall deactivate silently and set an error state reported on shutdown in case of non-recoverable errors.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The logging framework shall deactivate silently and set an error state reported on shutdown in case of non-recoverable errors.
In case of non-recoverable error, the logging framework shall deactivate silently and set an error state reported on shutdown.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall have low impact on overall system performance.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe low impact should be somehow / somewhere defined

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall provide QoS for handling overflows or dropping log messages.
Copy link
Contributor

Choose a reason for hiding this comment

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

Abbreviations section needed, e.g. for QoS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

add to glossary

:satisfies: stkh_req__dev_experience__logging_support
:status: valid

The logging framework shall be DLT (Diagnostic Log and Trace) compatible.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The logging framework shall be DLT (Diagnostic Log and Trace) compatible.
The logging framework shall be DLT compatible.

Copy link
Contributor

Choose a reason for hiding this comment

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

DLT which is used several times should be just part of Abbreviations / Glossary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

arsibo added 3 commits May 15, 2025 09:00
- Update the requirement with the review findings.
-  Add a glossary.
-  Remove tracing FR.
- Update the requirement with the review findings.
-  Add a glossary.
-  Remove tracing FR.
- Update the requirement with the review findings.
-  Add a glossary.
-  Remove tracing FR.
Copy link
Contributor

@LittleHuba LittleHuba left a comment

Choose a reason for hiding this comment

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

Fine to be merged as is. But please address my comments in a follow-up PR or keep track via tickets.

Motivation
==========

- currently no solution available in the score platform
Copy link
Contributor

Choose a reason for hiding this comment

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

This should also be a motivation why S-CORE needs to solve this problem.


- Possibility to provide an extension for custom types

Error handling
Copy link
Contributor

Choose a reason for hiding this comment

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

This should go into the error handling discussion that @ramceb is setting up.


Norms/Standards
---------------
The logging framework should be compatible with the Diagnostic Log and Trace (DLT) protocol. This includes:
Copy link
Contributor

Choose a reason for hiding this comment

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

should

Is this really optional?

Safety Impact
=============

- The interface should support the ASIL level of the user function.
Copy link
Contributor

Choose a reason for hiding this comment

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

Only the interface is not sufficient. The user application library in its fullness must support the ASIL level of the application.


.. 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

I see nothing about scheduling here.
A big concern for reproduction use cases is having no background threads or at least being able to conciously schedule background threads.


To activate this feature, use the following feature flag:

``experimental_Tracing``
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
``experimental_Tracing``
``experimental_tracing``

@arsibo arsibo merged commit 74b9c59 into main Jun 6, 2025
6 checks passed
@arsibo arsibo deleted the arsibo_FR_logging branch June 6, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request for Logging
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载