Repository navigation
Allow a Miniflare logger in Wrangler getPlatformProxy() #17137
gavar
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Use case
Framework dev servers such as OpenNext's
next devuse Wrangler'sgetPlatformProxy()for local Cloudflare bindings. When a localsend_emailbinding sends an email, Miniflare writes the HTML and text to temporary files. The paths are emitted through Miniflare's logger, which the platform proxy currently leaves unset.I'd like to print just the HTML path for a local email in the framework's dev console. I reproduced the missing output with Wrangler 4.161.0 and 4.166.0.
WRANGLER_LOG=debugleaves these Miniflare messages silent when using the platform proxy.Proposed API
Add an optional
logproperty toGetPlatformProxyOptionsand forward it to the Miniflare instance:A framework or application could pass a custom Miniflare
Logsubclass to filter the messages it displays. Omitting the option would preserve the existing default behavior. This would let adapters that forward platform proxy options support the same logging configuration.Related #10405 discussed console output from application code. This request concerns messages emitted by the Miniflare binding simulator.
The draft implementation in gavar/workers-sdk#1 includes a regression test for the simulated email HTML path.
All reactions