Closed davidjulien closed 3 weeks ago
I think it should be an optional dependency. Not every project has the decimal
dependency included.
I opened another PR where we checked if the Decimal
module is compiled to decide if the compiler includes the clause related to it. It was easier than I thought initialy.
Merged a PR that checks if Decimal is present, thank you ❤️
Awesome! 🚀
Hello!
Currently,
decimal
is added indirectly becauseecto
is an (optional) dependency inmix.exs
.However, if the project where you want to add
logger_json
doesn't haveecto
in its dependencies,decimal
is not added and thenlogger_json
doesn't compile:You can easily reproduce the bug by removing the
ecto
dependency in thelogger_json
mix.exs
file. You will see that thedecimal
dependency disappears indeps.tree
and that the lib doesn't compile anymore (same error as above).It may be interesting to refactor the code in another PR so that
decimal
encoding is not compiled whendecimal
dependency doesn't exist in the project.Regards