This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Setting aside the general "don't use writer monad for logging" advice I see, how do people usually handle this?
If you use it for logging, do people typically have a global writer that gets passed around (via reader monad/dependency injection) so everything can log the same way with just one configuration, or do modules usually define their own that is used just there, or what?
As practice I wanted to take the enterprise code I've been working on in Java and try to make it more functional in a different language in my free time. As is most Java enterprise code, each class has a private LOG
property that gets used inside that class to do logging, so each class defines its own logger.
So it just got me thinking about how people like to do this kind of thing in more functional code. (As part of the official project, some of the Java has been replaced by TypeScript and I've written that functional, but the logging is still just console logging and very sparse. I wonder how I might improve this part since console
logging in JS/TS is synchronous and thus blocking)
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/functionalp...