Skip to content

fix: ensure cosmian_logger build on wasm - even not used on wasm#23

Merged
Manuthor merged 3 commits into
developfrom
wasm
Jul 1, 2026
Merged

fix: ensure cosmian_logger build on wasm - even not used on wasm#23
Manuthor merged 3 commits into
developfrom
wasm

Conversation

@Manuthor

@Manuthor Manuthor commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

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 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-specific cfg gating 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-subscriber field 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.

Comment thread crate/logger/src/types.rs Outdated
Comment thread crate/logger/src/types.rs Outdated
@Manuthor Manuthor merged commit 5ba36b7 into develop Jul 1, 2026
11 checks passed
@Manuthor Manuthor deleted the wasm branch July 1, 2026 08:38
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.

3 participants