replikativ / datahike

A fast, immutable, distributed & compositional Datalog engine for everyone.
https://datahike.io
Eclipse Public License 1.0
1.62k stars 95 forks source link

unify error handling #54

Closed kordano closed 4 years ago

kordano commented 5 years ago

The exceptions should have a unified concept across all namespaces.

TimoKramer commented 4 years ago

Proposal: Error handling should be unified in the way that each error emits a unified log message of the level error. Additionally there should be e.g. deprecation logs for the old way of configuring datahike. That means using a library like clojure/tools.logging for the logging facade.

TimoKramer commented 4 years ago

for clojurescript support https://github.com/ptaoussanis/timbre might be a good option. what do you think?

whilo commented 4 years ago

I agree and timbre is definitely an option. I used a facade in kabel before:

https://github.com/replikativ/kabel/blob/master/src/kabel/platform_log.cljc

which allows us to change the logging system later as long as we just need a simple interface. It is not externally changeable, just a flexibility for the kabel developers. This limitation should be easy to overcome, either by multimethods or protocols.

@TimoKramer I would leave this decision to you, if you plan to go ahead. Using timbre directly can also be fine if we feel like maintaining a fork if necessary. I generally try to keep interfaces to external libraries minimal to help portability though. How should the interface in your opinion look like?