Skip to content

Conversation

@ghostwriternr
Copy link
Member

Removes unused logging infrastructure that was set up but never called. The codebase consistently uses explicit logger passing throughout.

  • Removed unused getLogger() and runWithLogger() functions
  • Updated CLAUDE.md with logging patterns
  • Cleaned up unused config exports

The AsyncLocalStorage infrastructure (loggerStorage, getLogger,
runWithLogger) was set up but never actually used. The codebase uses
explicit logger passing via constructor injection throughout.

This change removes the unused code, simplifies the logging module,
and documents the explicit passing pattern as the canonical approach.
The pattern works well for all scenarios including request context,
background operations, lifecycle events, and long-lived objects.

No breaking changes as the removed functions were never called.
@changeset-bot
Copy link

changeset-bot bot commented Nov 19, 2025

🦋 Changeset detected

Latest commit: a4fb135

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/sandbox Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

Looks good. This PR successfully removes unused logging infrastructure that was never called. The changes are clean and align perfectly with the codebase's explicit logger passing pattern.

What was verified:

  • getLogger() and runWithLogger() had zero usage in the codebase
  • All code uses explicit logger passing via constructor injection
  • Tests for deleted functionality appropriately removed
  • CLAUDE.md documentation accurately reflects the actual pattern
  • Config cleanup removes unused exports
  • No breaking changes (correctly marked as patch release)

Architecture:
Removing AsyncLocalStorage improves code clarity - explicit logger passing is simpler to reason about and test than implicit context propagation.

package-lock.json changes:
These are benign peer dependency marker movements from normal lock file maintenance, not actual dependency changes.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 19, 2025

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/sandbox-sdk/@cloudflare/sandbox@234

commit: 791ecf0

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2025

🐳 Docker Image Published

FROM cloudflare/sandbox:0.0.0-pr-234-641b7d2

Version: 0.0.0-pr-234-641b7d2

You can use this Docker image with the preview package from this PR.

Use 'vars' instead of 'env' for environment variables in wrangler template.
@ghostwriternr ghostwriternr merged commit d4cee5e into main Nov 19, 2025
7 of 9 checks passed
@ghostwriternr ghostwriternr deleted the cleanup-logger branch November 19, 2025 17:51
@threepointone threepointone mentioned this pull request Nov 19, 2025
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.

1 participant