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

Reduce amount of logging/make it optional #54

Open
viroulep opened this issue Feb 11, 2024 · 2 comments
Open

Reduce amount of logging/make it optional #54

viroulep opened this issue Feb 11, 2024 · 2 comments

Comments

@viroulep
Copy link
Contributor

I've started playing a bit more on real data: creating and assigning groups emits a lot of output; just providing a sample below:

Added group 7x7x7 Cube Round 1 Blue 1 from 2024-07-25T10:00:00.000+02:00 to 2024-07-25T10:35:00.000+02:00
Added group 7x7x7 Cube Round 1 Blue 2 from 2024-07-25T10:35:00.000+02:00 to 2024-07-25T11:10:00.000+02:00
Added group 7x7x7 Cube Round 1 Red 1 from 2024-07-25T10:00:00.000+02:00 to 2024-07-25T10:35:00.000+02:00
Added group 7x7x7 Cube Round 1 Red 2 from 2024-07-25T10:35:00.000+02:00 to 2024-07-25T11:10:00.000+02:00
...
3x3x3 Fewest Moves Round 1 Groups
Side 1 (368)
... followed by the table of the group

It's absolutely great to have that output, but the concatenation of everything makes it a bit hard to read.
It would be awesome to be able to "opt in" or "opt out" of these outputs (ideally I'd love to select a couple of interesting outputs, but not everything).

Is there an option/parameter I missed?
Would you be open to have a way to "silence" the output for some calls?

@timreyn
Copy link
Collaborator

timreyn commented Feb 12, 2024

I am open to any improvements to the output :)

When I ran scripts last year, though, I didn't do one mega script to assign all the groups -- I usually did
-build groups
-assign groups for event 1
-assign groups for event 2
-...

I found that easier to do incrementally, and check that every step worked as intended.

@viroulep
Copy link
Contributor Author

I proceed just like you (incrementally building stuff), but I took an approach where I always CleanWCIF first (to be able to fully reconstruct the WCIF from scratch).
It means I always get the output from the steps I previously tested, when I'd be interested in the last few steps.

IMO there are a couple of approaches to control the output:

  • add a way to suppress the output for a function (eg: something like -CreateGroups())
  • add a way to mark the beginning/end of a section where output is enabled/disabled, eg:
EnableOutput()
CreateGroups()
DisableOutput()
  • add an explicit generic Print function, and suppress any non-error log if it's not used (eg: Print(CreateGroups()))

Option 1 is likely too much work, option 2 looks quick and easy but maybe less nice than option 3, and option 3 looks good but I'm unsure about how much work it would be on the "dispatching" part.

Any opinion?

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

No branches or pull requests

2 participants