Skip to content

logging: Integrate score_log#73

Open
prabakaranklst wants to merge 1 commit intoeclipse-score:mainfrom
qorix-group:prabakaran_integrate_score_log
Open

logging: Integrate score_log#73
prabakaranklst wants to merge 1 commit intoeclipse-score:mainfrom
qorix-group:prabakaran_integrate_score_log

Conversation

@prabakaranklst
Copy link
Copy Markdown
Contributor

Integrated score_log under score-log feature with appropriate refactoring in the source code.

Notes for Reviewer

Pre-Review Checklist for the PR Author

  • PR title is short, expressive and meaningful
  • Commits are properly organized
  • Relevant issues are linked in the References section
  • Tests are conducted
  • Unit tests are added

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  • All open points are addressed and tracked via issues

References

Closes #67

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 13, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: 8b430408-77c9-46c8-9fe7-dc993524867f
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'rules_python', the root module requires module version rules_python@1.4.1, but got rules_python@1.8.3 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'bazel_skylib', the root module requires module version bazel_skylib@1.7.1, but got bazel_skylib@1.8.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.1.1, but got rules_cc@0.2.16 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'aspect_rules_lint', the root module requires module version aspect_rules_lint@1.0.3, but got aspect_rules_lint@2.0.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'buildifier_prebuilt', the root module requires module version buildifier_prebuilt@7.3.1, but got buildifier_prebuilt@8.2.0.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_rust_policies', the root module requires module version score_rust_policies@0.0.3, but got score_rust_policies@0.0.5 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 3 packages loaded
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)

Analyzing: target //:license-check (39 packages loaded, 9 targets configured)

Analyzing: target //:license-check (72 packages loaded, 9 targets configured)

Analyzing: target //:license-check (89 packages loaded, 9 targets configured)

Analyzing: target //:license-check (152 packages loaded, 1109 targets configured)

Analyzing: target //:license-check (156 packages loaded, 2935 targets configured)

Analyzing: target //:license-check (167 packages loaded, 3238 targets configured)

Analyzing: target //:license-check (167 packages loaded, 3250 targets configured)

Analyzing: target //:license-check (167 packages loaded, 3250 targets configured)

Analyzing: target //:license-check (168 packages loaded, 3251 targets configured)

Analyzing: target //:license-check (171 packages loaded, 5263 targets configured)

Analyzing: target //:license-check (171 packages loaded, 5263 targets configured)

INFO: Analyzed target //:license-check (172 packages loaded, 5389 targets configured).
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 213 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
[15 / 17] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
[16 / 17] [Prepa] Building license.check.license_check.jar ()
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 29.747s, Critical Path: 2.73s
INFO: 17 processes: 12 internal, 4 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 17 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html


use kyron_foundation::prelude::{error, CommonErrors};
use crate::macros::k_log::*;
#[cfg(feature = "score-log")]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there must be no ifdefs in code base. It shall be completely hidden from code base

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@pawelrutkaq There are many ifdefs in the code apart from #[cfg(feature = "score-log")]. Do you have any specific reason to remove score_log condition? Do you also want to remove cfg_attr?

#[cfg_attr(feature = "score-log", derive(ScoreDebug))]
#[derive(Clone, Copy, PartialEq, Eq)]
pub struct ReadinessState(u32);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ye I want that logging system choosing is done in a single place in best case and rest code base does not need to know details about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

},
Err(e) => {
error!("Error reading from mio object: {}", e);
k_error!("Error reading from mio object: {}", &format!("{}", e));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no strange names, shall be names as usual for log

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

fn fmt(
&self,
f: &mut dyn kyron_foundation::prelude::ScoreWrite,
spec: &kyron_foundation::prelude::FormatSpec,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

export in such a way that original signature is kept. Look into lifecycle repo or persistency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

drop(_guard); // We need to drop the lock before going into IO wait

debug!("Parking on IO Driver with timeout: {:?}", timeout);
k_debug!("Parking on IO Driver with timeout: {:?}", &format!("{:?}", timeout));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why such splits with seeprate format, shall not be like that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We get error for not implementing the trait ScoreDebug for Duration and similarly for other types in other places. So, added format() for such instances.

error[E0277]: the trait bound Duration: kyron_foundation::prelude::ScoreDebug is not satisfied
--> src/kyron/src/scheduler/workers/worker_types.rs:165:13
|
165 | k_debug!("Parking on IO Driver with timeout: {:?}", timeout);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait kyron_foundation::prelude::ScoreDebug is not implemented for Duration
|
= help: the following other types implement trait kyron_foundation::prelude::ScoreDebug:
&T
&mut T
()
Arc
Box
FromUtf8Error
HashMap<K, V, S>
IoEventInterest
and 35 others
= note: required for Option<Duration> to implement kyron_foundation::prelude::ScoreDebug
note: required by a bound in kyron_foundation::prelude::score_log::score_log_fmt::Placeholder::<'a>::new
--> external/score_baselibs_rust+/src/log/score_log_fmt/fmt.rs:73:4
= note: this error originates in the macro $crate::format_args which comes from the expansion of the macro k_debug (in Nightly builds, run with -Z macro-backtrace for more info)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to implement ScoreDebug for Duration in baselib_rust if not done already.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We get ScoreDebug trait not implemented error for below items.

1) std::io::Error
2) iceoryx2_cal::event::ListenerWaitError
3) core::net::parser::AddrParseError
4) core::time::Duration
5) std::result::Result<(), kyron_foundation::prelude::CommonErrors>
6) u128

@pawelrutkaq please let me know for which items the ScoreDebug to be implemented in baselibs_rust? I will create ticket accordingly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

u128, core::time::Duration. kyron_foundation::prelude::CommonErrors in this repo. core::net::parser::AddrParseError in QM part of baselib rust. std::io::Error maybe need local wrapper in this repo to be able to implement trait for it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created ticket eclipse-score/baselibs_rust#74 for u128, Duration and AddrParseError and assigned self.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Implemented ScoreDebug in baselibs_rust for Duration and AddrParseError, for CommonErrors in kyron-foundation. For other simple cases, to_string() is used instead of implementing ScoreDebug.
For std::result::Result<>, format!() is used since it is only one instance and implementing ScoreDebug with wrapper does not make any difference.

Integrated score_log under score-log feature with appropriate refactoring in the source code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Kyron] Integrate score_log from baselibs_rust into Kyron

2 participants