Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates cosmian_logger to compile for wasm32-unknown-unknown even when the crate isn’t used on wasm targets, and adds CI/pre-commit coverage for that build.
Changes:
- Added
wasm32-specificcfggating to avoid pulling in OTLP / SDK / syslog / file-rotation code on wasm. - Improved
__fn_name!macro stripping for async/closure contexts and added an async test. - Added a custom
tracing-subscriberfield formatter (named fields before message) and introduced a dedicated wasm build job + pre-commit hook.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crate/logger/src/types.rs | Adds wasm gating for OTLP SDK types and guards; adjusts config fields for wasm. |
| crate/logger/src/lib.rs | Splits subscriber init into wasm vs non-wasm paths; adds FieldsBeforeMessage formatter; gates OTLP helpers for wasm. |
| crate/logger/src/macros.rs | Enhances __fn_name! to strip async/closure anonymous segments. |
| crate/logger/src/tests.rs | Adds an async test for __fn_name! behavior in async fns. |
| crate/logger/src/error.rs | Gates OTLP exporter error variants on non-wasm. |
| crate/logger/Cargo.toml | Moves tokio/tonic/syscall-dependent deps behind non-wasm target deps. |
| .pre-commit-config.yaml | Adds a wasm build hook for cosmian_logger. |
| .github/workflows/ci.yml | Adds a wasm-build job to build cosmian_logger for wasm32-unknown-unknown. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
p0wline
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.