Closed kitsonk closed 3 months ago
Given the short lifetime of edge functions like Cloudflare Workers, it might not be necessary to use WeakRef
s in that environment. I'm not sure though. 🤔
I've just released LogTape 0.4.2, which must work on Cloudflare Workers.
@kitsonk Check it out!
There appear to be two issues that prevent logtape from working on Cloudflare Workers:
node:fs
as it isn't supported, even under node compat mode. I suspect this can be worked around by expanding thefilesink.web.ts
to be a full implementation and determine and then dynamically load that.LoggerImpl
usesWeakRef
, which Cloudflare Workers don't support. They claim there are some limitations/challenges to this, though the details are very vague. In logtape, this appears to be isolated to managing "child" loggers so that that they can be enumerated but not hold a strong reference so any children can be GC'ed. I don't know of an easy workaround to this.