Skip to content

feat(mw/log): add Linux syslog backend for LogMode::kSystem - #271

Draft
btirunagaru wants to merge 1 commit into
eclipse-score:mainfrom
qualcomm:feat/syslog_on_linux
Draft

feat(mw/log): add Linux syslog backend for LogMode::kSystem#271
btirunagaru wants to merge 1 commit into
eclipse-score:mainfrom
qualcomm:feat/syslog_on_linux

Conversation

@btirunagaru

@btirunagaru btirunagaru commented Aug 21, 2026

Copy link
Copy Markdown

Description

Adds a Linux syslog(3) backend for mw::log's LogMode::kSystem slot
(SyslogBackend + SyslogRecorderFactory + BackendRegistrant), following
the existing QNX slog backend's design. Includes unit tests against
score_baselibs//score/os/mocklib:syslog_mock covering log-level to
syslog-priority mapping and slot lifecycle.

Depends on the companion score::os::Syslog OS wrapper contributed to
baselibs (eclipse-score/baselibs#501,
@score_baselibs//score/os:syslog) — should merge/release together.

Related ticket

closes #270

Relates to eclipse-score/baselibs#501, implemented in eclipse-score/baselibs#502

Adds a Linux syslog mw::log backend that fills the LogMode::kSystem
slot on Linux (HGY aarch64 and x86 host), mirroring the existing QNX
slog backend exactly. slog is target_compatible_with os:qnx and this
new backend is target_compatible_with os:linux, so exactly one
compiles per build and both can safely reuse the same kSystem slot
without any LogMode/dispatch changes.

- score/mw/log/detail/syslog/syslog_backend.{h,cpp}: SyslogBackend,
  a Backend implementation whose FlushSlot formats
  "appid,ctxid: payload" and forwards to
  score::os::Syslog::syslog() at a severity mapped from mw::log's
  LogLevel (kFatal->LOG_CRIT, kError->LOG_ERR, kWarn->LOG_WARNING,
  kInfo->LOG_INFO, kDebug/kVerbose->LOG_DEBUG); Init() calls
  openlog(app_id, LOG_PID|LOG_NDELAY, LOG_USER).
- score/mw/log/detail/syslog/syslog_recorder_factory.{h,cpp}: CRTP
  SyslogRecorderFactory wiring a TextRecorder over SyslogBackend,
  using score::os::Syslog::Default() for the real OS wrapper.
- score/mw/log/detail/syslog/{syslog_backend_test,
  syslog_recorder_factory_test}.cpp: unit tests against
  @score_baselibs//score/os/mocklib:syslog_mock.
- score/mw/log/backend/syslog_registrant.cpp: registers
  CreateSyslogRecorder against LogMode::kSystem via
  BackendRegistrant, mirroring slog_registrant.cpp.
- score/mw/log/backend/BUILD: new syslog cc_library
  (target_compatible_with os:linux, alwayslink), plus the
  detail/syslog BUILD for syslog_backend/syslog_recorder_factory.

Depends on the companion score::os::Syslog OS wrapper contributed to
the baselibs component (@score_baselibs//score/os:syslog).

Signed-off-by: Bharath Tirunagaru <bharatht@qti.qualcomm.com>
@github-actions

Copy link
Copy Markdown

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.6.0) and connecting to it...
INFO: Invocation ID: 32ea3fb8-601b-49a4-8dd3-2ee5b3bc215a
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 4 packages loaded
Loading: 4 packages loaded
    currently loading: 
Loading: 4 packages loaded
    currently loading: 
WARNING: Target pattern parsing failed.
ERROR: Skipping '//:license-check': no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
ERROR: no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
INFO: Elapsed time: 11.103s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

feat: Add Linux syslog backend for mw::log LogMode::kSystem

1 participant