[XL] Change in fuchsia/fuchsia[main]: [syslog] Merge LogBuffer implementations

0 views
Skip to first unread message

'Chris Suter (Gerrit)' via owners-override

unread,
Aug 4, 2025, 4:03:45 AMAug 4
to Owners Override
Attention needed from Owners Override

Chris Suter has uploaded the change for review

Chris Suter would like Owners Override to review this change.

Commit message

[syslog] Merge LogBuffer implementations

On Fuchsia, we had two LogBuffer implementations, one in
structured_backend and another one that wrapped it. This change merges
the two. The new one is placed in the fuchsia_logging namespace and we
have aliases in the other namespaces pointing at the merged one. For
host code, we preserve the existing implementation.

This change also includes some changes where we moved internal code into
the fuchsia_logging namespace. Eventually, we will get rid of the
fucshia_syslog and syslog_runtime namespaces.

There are two functional changes here:

1. Flushing LogBuffer directly will not check and filter based on
severity. Callers are responsible for checking the severity. This
change should be fine as there are few direct callers and, in some
cases, the severity was being checked erroneously.

2. Related to the previous change, if the severity is FATAL, the caller
is responsible for aborting the program.

This functional change is motivated by the fact that we want to separate
flushing of the buffer from the buffer. As we are moving away from
sockets, we want `connection.FlushBuffer(buffer)` rather than making the
buffer hold on to a temporary reference to the connection.
Bug: 377963307
Change-Id: Ie358bf7f93cc86939f4eb32379fe809f8bd5979b

Change diff


Change information

Files:
  • M sdk/lib/driver/logging/cpp/driver_logging_cpp.api
  • M sdk/lib/driver/logging/cpp/internal/logger_internal.h
  • M sdk/lib/driver/logging/cpp/logger.h
  • M sdk/lib/syslog/cpp/BUILD.gn
  • M sdk/lib/syslog/cpp/backend_fuchsia_globals.api
  • M sdk/lib/syslog/cpp/host/encoder.h
  • A sdk/lib/syslog/cpp/host/log_buffer.cc
  • A sdk/lib/syslog/cpp/host/log_buffer.h
  • M sdk/lib/syslog/cpp/host/logging_backend.cc
  • M sdk/lib/syslog/cpp/log_message_impl.cc
  • M sdk/lib/syslog/cpp/log_message_impl.h
  • M sdk/lib/syslog/cpp/log_structure_unittest.cc
  • M sdk/lib/syslog/cpp/logging_backend_fuchsia.cc
  • M sdk/lib/syslog/cpp/logging_backend_fuchsia_globals.cc
  • M sdk/lib/syslog/cpp/logging_backend_fuchsia_globals.h
  • M sdk/lib/syslog/cpp/logging_unittest.cc
  • M sdk/lib/syslog/cpp/macros.h
  • M sdk/lib/syslog/cpp/syslog_cpp.api
  • M sdk/lib/syslog/structured_backend/BUILD.gn
  • M sdk/lib/syslog/structured_backend/README.md
  • M sdk/lib/syslog/structured_backend/cpp/fuchsia_syslog.h
  • R sdk/lib/syslog/structured_backend/cpp/log_buffer.cc
  • A sdk/lib/syslog/structured_backend/cpp/log_buffer.h
  • M sdk/lib/syslog/structured_backend/syslog_structured_backend.api
  • M src/connectivity/network/mdns/service/inspect.cc
  • M src/devices/lib/log/log.cc
  • M src/devices/lib/log/log.h
  • M src/devices/testing/syslog/fuzz-sdk.cc
  • M src/diagnostics/validator/logs/sink/puppet/cpp/puppet.cc
  • M src/diagnostics/validator/logs/sink/puppet/sdk/puppet.cc
  • M src/graphics/magma/lib/magma/platform/zircon/zircon_platform_logger_syslog.cc
  • M src/lib/android/logging/override/logging.cc
Change size: XL
Delta: 32 files changed, 668 insertions(+), 606 deletions(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Owners Override
Submit Requirements:
  • requirement satisfiedAPI-Review
  • requirement is not satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Ie358bf7f93cc86939f4eb32379fe809f8bd5979b
Gerrit-Change-Number: 1336164
Gerrit-PatchSet: 5
Gerrit-Owner: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Christopher Johnson <crj...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-Attention: Owners Override <owners-...@fuchsia.dev>

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/7cddd45dd840b17df234453bb2f0369d84e4dc4e-HTML%40fuchsia-review.googlesource.com.
satisfied_requirement
unsatisfied_requirement
open
diffy

'Chris Suter (Gerrit)' via owners-override

unread,
Aug 4, 2025, 4:03:58 AMAug 4
to Owners Override, Christopher Johnson, fuchsia-c...@fuchsia-infra.iam.gserviceaccount.com, GI Try Builder, CQ Bot
Attention needed from Owners Override

Chris Suter added 1 comment

File sdk/lib/syslog/structured_backend/cpp/fuchsia_syslog.h
Line 18, Patchset 5 (Latest):using fuchsia_logging::FlushConfig;
Christopher Johnson . resolved

Should these still be in the internal namespace?

Chris Suter

Probably, but if you don't mind, I'll follow up with that. I have subsequent CLs planned where I'll go through and remove the API we no longer want to expose.

Open in Gerrit

Related details

Attention is currently required from:
  • Owners Override
Submit Requirements:
  • requirement satisfiedAPI-Review
  • requirement is not satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Ie358bf7f93cc86939f4eb32379fe809f8bd5979b
Gerrit-Change-Number: 1336164
Gerrit-PatchSet: 5
Gerrit-Owner: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Christopher Johnson <crj...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-Attention: Owners Override <owners-...@fuchsia.dev>
Gerrit-Comment-Date: Mon, 04 Aug 2025 08:03:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Christopher Johnson <crj...@google.com>

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/7cddd45dd840b17df234453bb2f0369d84e4dc4e-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
satisfied_requirement
unsatisfied_requirement
open
diffy

'Adam Barth (Gerrit)' via owners-override

unread,
Aug 4, 2025, 10:45:38 AMAug 4
to Chris Suter, Owners Override, Christopher Johnson, fuchsia-c...@fuchsia-infra.iam.gserviceaccount.com, GI Try Builder, CQ Bot
Attention needed from Chris Suter and Owners Override

Adam Barth voted Owners-Override+1

Owners-Override+1
Open in Gerrit

Related details

Attention is currently required from:
  • Chris Suter
  • Owners Override
Submit Requirements:
  • requirement satisfiedAPI-Review
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Ie358bf7f93cc86939f4eb32379fe809f8bd5979b
Gerrit-Change-Number: 1336164
Gerrit-PatchSet: 5
Gerrit-Owner: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Adam Barth <aba...@google.com>
Gerrit-Reviewer: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Christopher Johnson <crj...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-Attention: Owners Override <owners-...@fuchsia.dev>
Gerrit-Attention: Chris Suter <csu...@google.com>
Gerrit-Comment-Date: Mon, 04 Aug 2025 14:45:30 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/b91aa7d382d2d43cafb7d26269dac29e6651764a-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
satisfied_requirement
open
diffy

'Chris Suter (Gerrit)' via owners-override

unread,
Aug 4, 2025, 3:49:18 PMAug 4
to Brian Bosak, Adam Barth, Owners Override, Christopher Johnson, fuchsia-c...@fuchsia-infra.iam.gserviceaccount.com, GI Try Builder, CQ Bot
Attention needed from Owners Override

Chris Suter voted Fuchsia-Auto-Submit+1

Fuchsia-Auto-Submit+1
Open in Gerrit

Related details

Attention is currently required from:
  • Owners Override
Submit Requirements:
  • requirement satisfiedAPI-Review
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Ie358bf7f93cc86939f4eb32379fe809f8bd5979b
Gerrit-Change-Number: 1336164
Gerrit-PatchSet: 6
Gerrit-Owner: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Adam Barth <aba...@google.com>
Gerrit-Reviewer: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Christopher Johnson <crj...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-CC: Brian Bosak <bbo...@google.com>
Gerrit-Comment-Date: Mon, 04 Aug 2025 19:48:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/53979e414628bb6aeb0042069c8221fcf29e5adb-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
satisfied_requirement
open
diffy

'CQ Bot (Gerrit)' via owners-override

unread,
Aug 4, 2025, 8:25:57 PMAug 4
to Chris Suter, Brian Bosak, Adam Barth, Owners Override, Christopher Johnson, fuchsia-c...@fuchsia-infra.iam.gserviceaccount.com, GI Try Builder

CQ Bot submitted the change

Unreviewed changes

5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Change information

Commit message:
[syslog] Merge LogBuffer implementations

On Fuchsia, we had two LogBuffer implementations, one in
structured_backend and another one that wrapped it. This change merges
the two. The new one is placed in the fuchsia_logging namespace and we
have aliases in the other namespaces pointing at the merged one. For
host code, we preserve the existing implementation.

This change also includes some changes where we moved internal code into
the fuchsia_logging namespace. Eventually, we will get rid of the
fucshia_syslog and syslog_runtime namespaces.

There are two functional changes here:

1. Flushing LogBuffer directly will not check and filter based on
severity. Callers are responsible for checking the severity. This
change should be fine as there are few direct callers and, in some
cases, the severity was being checked erroneously.

2. Related to the previous change, if the severity is FATAL, the caller
is responsible for aborting the program.

This functional change is motivated by the fact that we want to separate
flushing of the buffer from the buffer. As we are moving away from
sockets, we want `connection.FlushBuffer(buffer)` rather than making the
buffer hold on to a temporary reference to the connection.
Bug: 377963307
Change-Id: Ie358bf7f93cc86939f4eb32379fe809f8bd5979b
Reviewed-by: Christopher Johnson <crj...@google.com>
Owners-Override: Adam Barth <aba...@google.com>
Fuchsia-Auto-Submit: Chris Suter <csu...@google.com>
API-Review: Christopher Johnson <crj...@google.com>
Commit-Queue: Chris Suter <csu...@google.com>
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedAPI-Review: +1 by Christopher Johnson
  • requirement satisfiedCode-Review: +2 by Christopher Johnson
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Ie358bf7f93cc86939f4eb32379fe809f8bd5979b
Gerrit-Change-Number: 1336164
Gerrit-PatchSet: 7
Gerrit-Owner: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Adam Barth <aba...@google.com>
Gerrit-Reviewer: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Christopher Johnson <crj...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-CC: Brian Bosak <bbo...@google.com>

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/c23329548eb36c50a105298cfbc4939eae9bf603-HTML%40fuchsia-review.googlesource.com.
open
diffy
satisfied_requirement

'GI Roller (Gerrit)' via owners-override

unread,
Aug 4, 2025, 8:41:53 PMAug 4
to Chris Suter, CQ Bot, Brian Bosak, Adam Barth, Owners Override, Christopher Johnson, fuchsia-c...@fuchsia-infra.iam.gserviceaccount.com, GI Try Builder

Message from GI Roller

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedAPI-Review
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Ie358bf7f93cc86939f4eb32379fe809f8bd5979b
Gerrit-Change-Number: 1336164
Gerrit-PatchSet: 7
Gerrit-Owner: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Adam Barth <aba...@google.com>
Gerrit-Reviewer: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Christopher Johnson <crj...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-CC: Brian Bosak <bbo...@google.com>
Gerrit-Comment-Date: Tue, 05 Aug 2025 00:41:50 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/c2c0cb362886360a84a6a970234734a20455b155-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages