|
|
|
|
|
by edsrzf
1617 days ago
|
|
I agree logging is a bit of a code smell, but I prefer Mark Seemann's take: https://blog.ploeh.dk/2020/03/23/repeatable-execution/ TL;DR: Log impure actions. If you minimize and group side effects, you don't need to log as much. Pure functions can be recomputed any time if you know their inputs. Event buses can be useful, but it's hard to look at an event being published and know what it does and whether it's important. Whereas the importance of a logger call is usually pretty clear. Logs are rarely load-bearing, but an event can mean anything. |
|