pietroppeter / nimib

nimib 🐳 - nim 👑 driven ⛵ publishing ✍
https://pietroppeter.github.io/nimib/
MIT License
175 stars 10 forks source link

Make Nimib logging to stdout optional (`-d:nimibQuiet`) #242

Closed neroist closed 1 week ago

neroist commented 2 weeks ago

I'd rather not have Nimib print to stdout all the time & fill up the terminal (esp. when compiling multiple documents!), and its better for users to have the option to disable logging.

HugoGranstrom commented 2 weeks ago

This option makes a lot of sense to add 👍

neroist commented 2 weeks ago

Another issue I have is that Nimib changes the current directory, which forces me to change it back myself (I use Prologue which searches for ./.config). I'll make an issue when/if I'm able get the wording right, and PR if I'm able to fix it.

pietroppeter commented 2 weeks ago

Thanks for this PR, it definitely makes sense to add the flag!

This also will help the moment we want to improve logging in some way (but not doing that before someone has a clear use case or a need ;)).

@HugoGranstrom not sure if you also want to review, otherwise for me this is good to merge!

pietroppeter commented 2 weeks ago

Another issue I have is that Nimib changes the current directory, which forces me to change it back myself (I use Prologue which searches for ./.config). I'll make an issue when/if I'm able get the wording right, and PR if I'm able to fix it.

yes, there is a reason it changes directory (to access/create assets in the "build" directory, actually called homeDir, so that if I generate an image it is part of the assets that the static site will be able to see), but I can see other use cases not wanting that. I think it make sense to add a flag there (we are starting to have a bunch of them, at some point we might want to document them somewhere).

For reference, the change of directory is here: https://github.com/pietroppeter/nimib/blob/02b525313311c9ee8e74aa432af9cb89cbd4b3a0/src/nimib.nim#L46

pietroppeter commented 2 weeks ago

...and I just realized that this feature (-d:nimibLog) should be documented somewhere (I guess in the Readme/nimib main doc), otherwise it is only for the insiders :)

HugoGranstrom commented 2 weeks ago

A bit of documentation and I'm content with merging this 😁🚀

neroist commented 1 week ago

looking at docsrc/config.nims I realize that nimibQuiet is probably a better & more elegant name than nimibNoLog 😅

HugoGranstrom commented 1 week ago

looking at docsrc/config.nims I realize that nimibQuiet is probably a better & more elegant name than nimibNoLog 😅

Oh look at that :o Yes nimibQuiet would probably be a better name for the switch

neroist commented 1 week ago

name changed & docs added! 👍

pietroppeter commented 1 week ago

haha, forgot about that nimibQuiet, I must have introduced it back then for the same purpose :) I am a bit on the fence on the change of name since nimibNoLog was really clear in its purpose, but nimibQuiet is more playful and you both seem to approve of it.

thanks again, looks good, will edit the title (so that when we make the changelog it will be already correct) and will merge this.