-
-
Notifications
You must be signed in to change notification settings - Fork 404
Open
Description
Bug Report
Description
When using Effect.log()
with Logger.pretty
in Cloudflare Workers, the first argument is consistently missing from the log output. Single-argument log calls produce no output at all.
Environment
- Effect Version: 3.17.7
- Runtime: Cloudflare Workers (Wrangler 3.114.13)
- Logger:
Logger.pretty
Expected Behavior
All arguments passed to Effect.log()
should be logged:
Effect.log("First", "second", "third") // Should show: "First second third"
Effect.log("Single test") // Should show: "Single test"
Actual Behavior
First argument is missing, single arguments disappear:
Effect.log("First", "second", "third") // Shows: "second third"
Effect.log("Single test") // Shows: (nothing)
Reproduction
Repository: https://github.com/schickling-repros/2025-08-effect-pretty-logger-cloudflare
Steps:
- Clone the reproduction repo
- Run
pnpm install && pnpm dev
- Execute
curl http://localhost:8787
- Observe missing first arguments in console
Comparison with Default Logger
The default logger works correctly and shows all arguments as separate message=
fields:
timestamp=2025-08-18T13:43:37.844Z level=INFO fiber=#0 message="First argument" message="second argument" message="third argument"
Impact
- Silent data loss in logging output
- Debugging difficulties as primary context is often the first argument
- Single-argument logs completely disappear
Code Sample
import { Effect, Logger } from "effect"
const program = Effect.gen(function* () {
yield* Effect.log("Context:", "important", "data") // Only shows "important data"
yield* Effect.log("Debug info") // Shows nothing
})
await Effect.runPromise(
program.pipe(Effect.provide(Logger.pretty))
)
This appears to be specific to the Cloudflare Workers environment, as the bug doesn't occur with the default structured logger.
Metadata
Metadata
Assignees
Labels
No labels