Weird Behaviors with Custom Loggers and Errors
Hi everybody!
I've been playing with custom loggers and errors and found some weird behaviors.
This is the code I'm running: https://github.com/devmatteini/effect-playground/blob/f3bf57d9ff4d90977398f224701f583a005ca35e/src/custom-logger.ts
If I run the code without specifying the
The first "problem" I noticed is that the first two logs are not using my custom logger. Is it supposed to work like this?
Also, about the second log, since I'm using
After some tests, I found out that providing
and the console output:
I've been playing with custom loggers and errors and found some weird behaviors.
This is the code I'm running: https://github.com/devmatteini/effect-playground/blob/f3bf57d9ff4d90977398f224701f583a005ca35e/src/custom-logger.ts
If I run the code without specifying the
NAME environment variable with npx tsx src/custom-logger.ts I get the following output:The first "problem" I noticed is that the first two logs are not using my custom logger. Is it supposed to work like this?
Also, about the second log, since I'm using
Effect.runPromiseExit I wasn't expecting a Fiber terminated with a non handled error. Am I missing something?After some tests, I found out that providing
DepsLive and Logger with two different Effect.provide calls resolves both “problems”:and the console output:
