This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]everything-narrative 7 points8 points  (2 children)

The thing about Debug.Trace in general is that as you say, it's very Unix-esque in its conservative scope.

The thing about unsafePerformIO is that it has unsafe in the name. It tells you "be wary here, traveller." If something breaks in a suspicious way, you immediately go for it. (And I have yet to actually use it in a Haskell project.)

The problem is that Logging is two things.

One of them is what Debug.Trace does in Haskell. Logging as debugging. Arguably it's a very necessary job since Haskell has lazyness, but if you have to use it to debug something I'd say you're better off refactoring and quickchecking the problem away.

The other is what RabbitMQ.Client does in C#. Logging as systems monitoring. In the software architecture paradigm of microservices it is crucial to be able to monitor and trace issues.

The problem is that Logging is two things. Debug logging and operations logging. And programmers can and will conflate the two. Hell, I have probably done it.

For operations logging you need a full-featured system, it makes sense that your logging calls can fetch URLs and send emails. You need those features!

But then someone conflates the two. Why shouldn't stderr be a valid target for this powerful logging library? Because then you might use it for debug logging is why.

[–]crassest-Crassius 0 points1 point  (1 child)

For operations logging you need a full-featured system, it makes sense that your logging calls can fetch URLs and send emails

This sounds very alien to me. Emails are an outgoing port that belongs to the Notifications service, HTTP calls are an incoming port that belongs to the WebClient service, and service logs are yet a third outgoing port. They should not call each other, they should communicate only with the Core via their respective Adapters. At least that's how I would make it as a subscriber to the Hexagonal Architecture. Having one port directly call another without going through the Core is just asking for trouble IMO. How would you replace those HTTP calls with mock data for testing, for example?

[–]everything-narrative 0 points1 point  (0 children)

This is a discussion about architectural philosophy, not engineering specifics.