Skip to content

Follow up: add log prefix - #2293

Open
cedric-cordenier wants to merge 1 commit into
mainfrom
add-log-prefix
Open

Follow up: add log prefix#2293
cedric-cordenier wants to merge 1 commit into
mainfrom
add-log-prefix

Conversation

@cedric-cordenier

Copy link
Copy Markdown
Contributor

Requires

Supports

Copilot AI review requested due to automatic review settings July 29, 2026 17:01
@cedric-cordenier
cedric-cordenier requested a review from a team as a code owner July 29, 2026 17:01
@github-actions

Copy link
Copy Markdown
Contributor

👋 cedric-cordenier, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📊 API Diff Results

No changes detected for module github.com/smartcontractkit/chainlink-common

View full report

Copilot AI left a comment

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.

Pull request overview

This PR adjusts host-side handling of WASM guest log messages so that guest-requested panic/fatal log levels are still downgraded to error (to avoid crashing/exiting the host), but are now distinguishable via a prefix in the log message.

Changes:

  • Add explicit message prefixes when guest logs at panic or fatal level (while still logging at error).
  • Relax the existing test assertion to no longer require an exact log message match.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/workflows/wasm/host/module.go Adds distinct prefixes for downgraded panic/fatal guest log messages.
pkg/workflows/wasm/host/logging_test.go Updates the test assertion for panic/fatal logging behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1081 to +1086
case "panic":
// The guest should never be able to panic/exit the host
logger.Errorw(sanitizedMsg, args...)
logger.Errorw("[panic] "+sanitizedMsg, args...)
case "fatal":
// The guest should never be able to panic/exit the host
logger.Errorw("[fatal] "+sanitizedMsg, args...)
Comment on lines 28 to 32
entries := logs.All()
require.Len(t, entries, 1)
require.Equal(t, zapcore.ErrorLevel, entries[0].Level)
require.Equal(t, "boom", entries[0].Message)
require.Contains(t, entries[0].Message, "boom")
})
Copilot AI review requested due to automatic review settings July 31, 2026 09:27

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants