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

several small improvements #177

Merged
merged 8 commits into from
Oct 4, 2024
Merged

several small improvements #177

merged 8 commits into from
Oct 4, 2024

Conversation

Itxaka
Copy link
Collaborator

@Itxaka Itxaka commented Oct 4, 2024

see commits for explanation

Signed-off-by: Itxaka [email protected]

Itxaka added 5 commits October 4, 2024 16:12
We were generating it for the DAG op but never used if it was empty
Also use litter to dump the stage contents with a cleanup so it doesnt
show empty fields

Signed-off-by: Itxaka <[email protected]>
Its too heavy and always the same info (its run on init) so having it
repeated time and time can get pretty bad. This makes the logs much
nicer and cleaner

Signed-off-by: Itxaka <[email protected]>
Otherwise it gets reproted several times

Signed-off-by: Itxaka <[email protected]>
@Itxaka Itxaka requested a review from mudler October 4, 2024 14:41
var errs error
for _, p := range e.conditionals {
if err := p(e.logger, stage, fs, console); err != nil {
e.logger.Warnf("(conditional) Skip '%s' stage name: %s",
err.Error(), stage.Name)
err.Error(), stageName)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This diff with the actual Apply method was causing the DAG to be created properly with names generated if the stage had no name, but then on the log it will still shop as empty.

b, _ := json.Marshal(stage)
e.logger.Debugf("Stage: %s", string(b))
litter.Config.HideZeroValues = true
e.logger.Debugf("Stage: %s", litter.Sdump(stage))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this dumps the actual stages in a much more nicer way. It shows no empty values, so only things that are gonna be run and its in a nice structured way which makes it simpler to understand visually.

pkg/plugins/commands.go Outdated Show resolved Hide resolved
l.Debug(string(data))
litter.Config.HideZeroValues = true
litter.Config.HidePrivateFields = true
l.Trace(litter.Sdump(&system))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same as the other but put this on trace level. We dont usually need this as part of the debug part and its very ugly,big and pollutes the log with a lot of useless, repeated info.

pkg/plugins/layout.go Outdated Show resolved Hide resolved
Copy link
Owner

@mudler mudler left a comment

Choose a reason for hiding this comment

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

Looking good!

@mudler mudler merged commit 87b55bb into master Oct 4, 2024
3 checks passed
@mudler mudler deleted the minor_improvs branch October 4, 2024 17:55
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.

2 participants