Effect CommunityEC
Effect Community2y ago
10 replies
Toby

Creating an Effectful Logger with Logger.make

I know Effect.logX is effectful, but is it possible to create an effectful logger i.e.

const myLogger = Logger.make((options) => {
  // this
  return E.sync(() => globalThis.console.log(options.message))
  // not this
  // globalThis.console.log(options.message)
})


The reason is that I'm trying to reuse some of my other effects within the logger (so not actually console.log)
Was this page helpful?