feat: add promslog.NewNopLogger() convenience func by tjhop · Pull Request #697 · prometheus/common (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation4 Commits1 Checks2 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

tjhop

Simple convenience function to return an slog.Logger that writes to io.Discard. Originally suggested by @ArthurSens
here, and requested again by @bboreham
here. As Bryan points out in the comment, there's 147 instances where a discard logger is needed, so a consistent utility function to manage them seems helpful.

@tjhop

Simple convenience function to return an slog.Logger that writes to io.Discard. Originally suggested by @ArthurSens [here](prometheus#686 (comment)), and requested again by @bboreham [here](prometheus/prometheus#14906 (comment)). As Bryan points out in the comment, there's 147 instances where a discard logger is needed, so a consistent utility function to manage them seems helpful.

Signed-off-by: TJ Hoplock t.hoplock@gmail.com

@tjhop tjhop mentioned this pull request

Sep 27, 2024

tjhop added a commit to tjhop/prometheus that referenced this pull request

Sep 27, 2024

@tjhop

For: prometheus#14355

Requires a new release of prometheus/common to be cut, as this depends on the following PRs:

prometheus/common#694 prometheus/common#697

This commit updates Prometheus to adopt stdlib's log/slog package in favor of go-kit/log. As part of converting to use slog, several other related changes are required to get prometheus working, including:

Signed-off-by: TJ Hoplock t.hoplock@gmail.com

SuperQ

tjhop added a commit to tjhop/snmp_exporter that referenced this pull request

Sep 29, 2024

@tjhop

Requires: prometheus/common#697

This PR includes:

The bulk of this PR was automated by the following script which is being used to aid in converting the various exporters/projects to use slog:

https://gist.github.com/tjhop/49f96fb7ebbe55b12deee0b0312d8434

Builds and passes tests locally with go workspaces and up-to-date main branch of prometheus/common.

Signed-off-by: TJ Hoplock t.hoplock@gmail.com

tjhop added a commit to tjhop/mysqld_exporter that referenced this pull request

Sep 29, 2024

@tjhop

Requires: prometheus/common#697

This PR includes:

The bulk of this PR was automated by the following script which is being used to aid in converting the various exporters/projects to use slog:

https://gist.github.com/tjhop/49f96fb7ebbe55b12deee0b0312d8434

Builds and passes tests locally with go workspaces and up-to-date main branch of prometheus/common.

Signed-off-by: TJ Hoplock t.hoplock@gmail.com

@tjhop tjhop mentioned this pull request

Sep 29, 2024

tjhop added a commit to tjhop/prometheus that referenced this pull request

Sep 29, 2024

@tjhop

For: prometheus#14355

Requires a new release of prometheus/common to be cut, as this depends on the following PRs:

prometheus/common#694 prometheus/common#697

This commit updates Prometheus to adopt stdlib's log/slog package in favor of go-kit/log. As part of converting to use slog, several other related changes are required to get prometheus working, including:

Signed-off-by: TJ Hoplock t.hoplock@gmail.com

tjhop added a commit to tjhop/prometheus that referenced this pull request

Sep 29, 2024

@tjhop

tjhop added a commit to tjhop/prometheus that referenced this pull request

Sep 29, 2024

@tjhop

tjhop added a commit to tjhop/prometheus that referenced this pull request

Sep 29, 2024

@tjhop

tjhop added a commit to tjhop/memcached_exporter that referenced this pull request

Sep 29, 2024

@tjhop

Requires: prometheus/common#697

This PR includes:

The bulk of this PR was automated by the following script which is being used to aid in converting the various exporters/projects to use slog:

https://gist.github.com/tjhop/49f96fb7ebbe55b12deee0b0312d8434

Builds and passes tests locally with go workspaces and up-to-date main branch of prometheus/common.

Signed-off-by: TJ Hoplock t.hoplock@gmail.com

@tjhop tjhop mentioned this pull request

Sep 29, 2024

SuperQ pushed a commit to prometheus/memcached_exporter that referenced this pull request

Oct 10, 2024

@tjhop

Signed-off-by: TJ Hoplock t.hoplock@gmail.com

Requires: prometheus/common#697

This PR includes:

The bulk of this PR was automated by the following script which is being used to aid in converting the various exporters/projects to use slog:

https://gist.github.com/tjhop/49f96fb7ebbe55b12deee0b0312d8434

Builds and passes tests locally with go workspaces and up-to-date main branch of prometheus/common.

Signed-off-by: TJ Hoplock t.hoplock@gmail.com

Signed-off-by: TJ Hoplock t.hoplock@gmail.com


Signed-off-by: TJ Hoplock t.hoplock@gmail.com

SuperQ pushed a commit to prometheus/mysqld_exporter that referenced this pull request

Oct 10, 2024

@tjhop

Requires: prometheus/common#697

This PR includes:

The bulk of this PR was automated by the following script which is being used to aid in converting the various exporters/projects to use slog:

https://gist.github.com/tjhop/49f96fb7ebbe55b12deee0b0312d8434

Builds and passes tests locally with go workspaces and up-to-date main branch of prometheus/common.

Signed-off-by: TJ Hoplock t.hoplock@gmail.com

Signed-off-by: TJ Hoplock t.hoplock@gmail.com


Signed-off-by: TJ Hoplock t.hoplock@gmail.com

2 participants

@tjhop @SuperQ