• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hyperledger-labs / fabric-smart-client / 30294154788 / 1
81%
main: 81%

Build:
DEFAULT BRANCH: main
Ran 27 Jul 2026 06:44PM UTC
Files 479
Run time 30s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Jul 2026 06:31PM UTC coverage: 28.2% (-0.04%) from 28.235%
30294154788.1

push

github

web-flow
feat(logging): extract context values into context-aware log lines as zap fields (#1608)

* feat(logging): extract registered context values into context-aware log lines

Context-aware log methods (InfowContext, ErrorfContext, ...) only used the
context to emit an OTel span event; nothing in it ever reached the zap log
line. Adds a declarative (context key -> field name) registry, configurable
via Init(Config{ContextLogFields: ...}) or RegisterContextLogField (mirrors
the existing Replacers pattern), so registered values are auto-attached to
every context-aware log call as zap.Any fields.

The decorator level-gates before extracting (SugaredLogger.Level() check) so
disabled log calls stay near-zero-cost regardless of registry size, and the
*w*Context methods append fields directly into keysAndValues instead of
calling With(), avoiding an extra logger-clone allocation on the enabled
path.

Refs #1607.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>

* perf(logging): make context-field extraction allocation-free when absent

Publish an immutable snapshot of registered ContextLogFields so the hot
read path avoids lock contention and per-call copies, and skip allocating
the combined args/fields slice until a registered key is actually found
in the context. Add benchmarks covering registry size and hit/miss
context scenarios, and a test covering a named string context key type.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>

* test(logging): cover dynamic registration and nested context wrapping

Add tests proving RegisterContextLogField affects already-constructed
loggers immediately, that repeated registrations accumulate rather than
replace, and that registered fields still resolve when the carrying
context is wrapped multiple times (WithValue/WithCancel/WithTimeout) after
the value was set.

Co-Authored-By: Claude Sonnet 5 <noreply@a... (continued)

10124 of 35901 relevant lines covered (28.2%)

10.42 hits per line

Source Files on job itest-fabric-atsachaincode - 30294154788.1
  • Tree
  • List 479
  • Changed 4
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 30294154788
  • 4e9ea34d on github
  • Prev Job for on main (#30294090796.13)
  • Next Job for on main (#30338257600.4)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc