Utilize the `Logger` module for logging purposes
Closed this issue · 3 comments
Currently, there are three areas, the Knigge.Warnings
and Knigge.Options
modules using the native IO
module, and another in the Knigge.CLI.Output
module using the third party Bunt
library.
I think it would be better to utilize the Logger
module directly to ensure logs go through to whatever logging backend the users utilize, at least (especially?) in the non CLI modules.
What do you think @sascha-wolf?
All warnings in Knigge.Warning
are being emitted at compile time. They're basically compilation warnings.
All output from Knigge.CLI.Output
gets emitted when running mix knigge.verify
.
That means no output is being emitted at runtime of your application. If Knigge did generate runtime output, then yes, it would certainly make sense to rely on Logger
for this, as to respect the applications logger configuration (such as format and backends).
Can you elaborate on why you think that using Logger
would be beneficial in the mentioned scenarios?
Oh it missed me that those logs are only at compile time! Yea in that case I don't think there's much need for changing to using Logger
.
The only scenario where it would be somewhat beneficial (I think) is for the CLI as to avoid depending on anything else but that's quite a minor thing (if it matters at all)!
I think we can just close this as it's not really an issue since those are just emitted at compile time!
Sorry for taking your time to check this ❤️
No worries, @ojizero. Thanks for taking an interest; I'm gonna close this now. 🙂
And FYI regarding the usage of Bunt
in the Knigge.CLI.Output
module, it's used to generate colored output. When mix knigge.verify
finds no issues, it prints [Name of the facade] -> [Name of the implementation]
in green, and if finds any faults, it print it in red. That's what Bunt
is used for.