Skip to content

Commit 08a09b7

Browse files
integrate logging example
1 parent 38c3c66 commit 08a09b7

7 files changed

Lines changed: 480 additions & 559 deletions

File tree

MODULE.bazel.lock

Lines changed: 453 additions & 543 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel_common/score_modules_target_sw.MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ git_override(
7272
bazel_dep(name = "score_logging")
7373
git_override(
7474
module_name = "score_logging",
75-
commit = "254fdfe0e35a2738917fb16d41bb70acc83f32ad",
75+
commit = "3da15793ed76bc8b97cffe379345f3c3d61c17cd",
7676
patch_strip = 1,
7777
patches = [
7878
"//patches/logging:001-logging-example-visibility.patch",

feature_integration_tests/itf/test_remote_logging.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
CAPTURE_DURATION_SECONDS = 10
2828

2929
# DLT message identifiers for datarouter statistics
30-
APP_ID = "DR"
31-
CTX_ID = "STAT"
30+
31+
APP_ID = "EXA"
32+
CTX_ID = "DFLT"
3233

3334
_QNX_DATAROUTER_CHECK_CMD = "/proc/boot/pidin | /proc/boot/grep datarouter"
3435
_LINUX_DATAROUTER_CHECK_CMD = "ps -ef | grep datarouter | grep -v grep"
@@ -40,6 +41,9 @@
4041
"./datarouter --no_adaptive_runtime > /dev/null 2>&1 &"
4142
)
4243
_LINUX_DATAROUTER_START_CMD = "cd /usr/bin/datarouter && nohup ./datarouter --no_adaptive_runtime > /dev/null 2>&1 &"
44+
45+
46+
_LOGGINGAPP_START_CMD = "cd /showcases/data/logging/logging_app/etc && nohup /showcases/bin/logging_app &"
4347
# Multicast route directs all multicast traffic (224.0.0.0/4) out of the containers
4448
# network interface required for DLT messages to reach the host via the Docker bridge.
4549
_LINUX_CHECK_MULTICAST_ROUTE_CMD = "ip route add 224.0.0.0/4 dev eth0 2>/dev/null || true"
@@ -85,7 +89,7 @@ def datarouter_running(target):
8589
yield
8690

8791

88-
def test_remote_logging(datarouter_running, dlt_config):
92+
def test_remote_logging(datarouter_running, target, dlt_config):
8993
"""Verifies remote logging of Dataraouter
9094
9195
Starts Datarouter on the target if not already running, then
@@ -100,6 +104,10 @@ def test_remote_logging(datarouter_running, dlt_config):
100104
print_to_stdout=True,
101105
binary_path=dlt_config.dlt_receive_path,
102106
) as window:
107+
logger.info("Starting logging app to generate DLT messages..")
108+
exit_code, out = target.execute(_LOGGINGAPP_START_CMD)
109+
logger.debug("Logging app start command exit_code=%s", exit_code)
110+
103111
time.sleep(CAPTURE_DURATION_SECONDS)
104112

105113
record = window.record(filters=[(APP_ID, CTX_ID)])

known_good.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,12 @@
9797
},
9898
"score_logging": {
9999
"repo": "https://github.com/eclipse-score/logging.git",
100-
"hash": "254fdfe0e35a2738917fb16d41bb70acc83f32ad",
100+
"hash": "3da15793ed76bc8b97cffe379345f3c3d61c17cd",
101101
"bazel_patches": [
102102
"//patches/logging:001-logging-example-visibility.patch",
103103
"//patches/logging:002-deps-visibility.patch"],
104104
"metadata": {
105+
"code_root_path": "//score/mw/...",
105106
"extra_test_config": [
106107
"@score_logging//score/datarouter/build_configuration_flags:persistent_logging=False",
107108
"@score_logging//score/datarouter/build_configuration_flags:persistent_config_feature_enabled=False",

rust_coverage/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ rust_coverage_report(
8282
"linux-x86_64",
8383
"ferrocene-coverage",
8484
],
85-
query = 'kind("rust_test", @score_logging//score/...) -@score_logging//score/datarouter/test/ut/ut_logging:dltprotocolUT -@score_logging//score/datarouter/test/ut/ut_logging:persistentLogConfigUT -@score_logging//score/datarouter/test/ut/ut_logging:socketserverConfigUT -@score_logging//score/datarouter/test/ut/ut_logging:socketserverUT -@score_logging//score/mw/log/legacy_non_verbose_api:unit_test',
85+
query = 'kind("rust_test", @score_logging//score/mw/...) -@score_logging//score/datarouter/test/ut/ut_logging:dltprotocolUT -@score_logging//score/datarouter/test/ut/ut_logging:persistentLogConfigUT -@score_logging//score/datarouter/test/ut/ut_logging:socketserverConfigUT -@score_logging//score/datarouter/test/ut/ut_logging:socketserverUT -@score_logging//score/mw/log/legacy_non_verbose_api:unit_test',
8686
visibility = ["//visibility:public"],
8787
)

showcases/standalone/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Logging Example
2+
3+
This example demonstrates **Console Logging** and **Remote Logging**.
4+
5+
It is available in the menu along with other examples.
6+
7+
For configuration and detailed information, click below:
8+
9+
[DLT Documentation](https://github.com/eclipse-score/logging/blob/main/score/datarouter/doc/guideline/dlt_capture_demo.md)
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
[
2-
{
1+
{
32
"name": "Logging example",
43
"description": "Example for running logging with all log levels via remote and console",
54
"apps": [
@@ -16,13 +15,8 @@
1615
"args": [],
1716
"env": {},
1817
"dir": "/showcases/data/logging/logging_app/etc"
19-
}
20-
]
21-
},
22-
{
23-
"name": "logging : dlt Generator example",
24-
"description": "Example for generating DLT log messages",
25-
"apps": [
18+
},
19+
2620
{
2721
"path": "/showcases/bin/dlt_generator",
2822
"args": [],
@@ -31,4 +25,3 @@
3125
}
3226
]
3327
}
34-
]

0 commit comments

Comments
 (0)