Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

neroist
Copy link
Contributor

@neroist neroist commented Jun 16, 2024

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
Copy link
Collaborator

This option makes a lot of sense to add 👍

@neroist
Copy link
Contributor Author

neroist commented Jun 16, 2024

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.

Copy link
Owner

@pietroppeter pietroppeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! (the only moment I paused is the echo left in blocks.nim, but I get that since we have a different type of output "prefix" we cannot reuse log and leaving the echo seems the most appropriate thing)

@pietroppeter
Copy link
Owner

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
Copy link
Owner

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:

if nb.cfg.homeDir != "":

@pietroppeter
Copy link
Owner

...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
Copy link
Collaborator

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

@neroist
Copy link
Contributor Author

neroist commented Jun 18, 2024

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

@HugoGranstrom
Copy link
Collaborator

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
Copy link
Contributor Author

neroist commented Jun 18, 2024

name changed & docs added! 👍

@pietroppeter
Copy link
Owner

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.

@pietroppeter pietroppeter changed the title Make Nimib logging optional (-d:nimibNoLog) Make Nimib logging optional (-d:nimibQuiet) Jun 20, 2024
@pietroppeter pietroppeter changed the title Make Nimib logging optional (-d:nimibQuiet) Make Nimib logging to stdout optional (-d:nimibQuiet) Jun 20, 2024
@pietroppeter pietroppeter merged commit 6daf489 into pietroppeter:main Jun 20, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants