Skip to content

chore: simplify generating metrics docs #810

Merged
mmatczuk merged 3 commits intomainfrom
mmt/better_metrics_docs
May 23, 2024
Merged

chore: simplify generating metrics docs #810
mmatczuk merged 3 commits intomainfrom
mmt/better_metrics_docs

Conversation

@mmatczuk
Copy link
Contributor

No description provided.

@mmatczuk mmatczuk requested a review from Choraden as a code owner May 22, 2024 13:16
cmd.SetErr(io.Discard)

var stdout *os.File
stdout, os.Stdout = os.Stdout, os.NewFile(10, os.DevNull)
Copy link
Contributor

Choose a reason for hiding this comment

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

What does the '10' stand for here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

file descriptor

mmatczuk added 2 commits May 23, 2024 10:59
The descMetrics flag is changed to unbound dryRun field that performs a regular dry-run.

Internal command creation is extracted to method.

Metrics() function is added, this avoids encoding json data to stdout.
@mmatczuk
Copy link
Contributor Author

Refactored that to log config

	c.logConfig = &log.Config{
		Level: log.ErrorLevel,
		File:  os.NewFile(10, os.DevNull),
	}

@mmatczuk mmatczuk force-pushed the mmt/better_metrics_docs branch from c57fcc2 to 17ec238 Compare May 23, 2024 09:02
@mmatczuk mmatczuk merged commit 68c8f20 into main May 23, 2024
@mmatczuk mmatczuk deleted the mmt/better_metrics_docs branch May 23, 2024 09:10
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