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

Config inspection #129

Merged
merged 1 commit into from Jan 9, 2022
Merged

Config inspection #129

merged 1 commit into from Jan 9, 2022

Conversation

elijaharita
Copy link
Contributor

This ended up being a totally microscopic change, but it'll be extremely useful to library users. It is non-breaking change.

This saves the config into a private global variable upon applying it. You can call GetConfig() to read a copy of the config, and then it can be modified and re-applied using SetupLogging().

More info at #122. This solution is probably nicer than exposing configFromEnv(), because it reflects the actual current state of the logger, which could potentially change before configFromEnv() is next called.

@welcome
Copy link

welcome bot commented Dec 16, 2021

Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions
    and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the
    rest) and in its best form. Follow the code contribution
    guidelines

    if they apply.

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on
    any missing things and potentially assigning a reviewer for high
    priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution.
We are very grateful for your contribution!

Copy link
Contributor

@ribasushi ribasushi left a comment

Choose a reason for hiding this comment

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

This is great and so much simpler than I initially envisioned.

:shipit:

@marten-seemann marten-seemann merged commit 370cc50 into ipfs:master Jan 9, 2022
github-actions bot pushed a commit to kairos-io/provider-kairos that referenced this pull request Apr 19, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/ipfs/go-log](https://togithub.com/ipfs/go-log) | `v1.0.5`
-> `v2.5.1` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fipfs%2fgo-log/v2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fipfs%2fgo-log/v2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fipfs%2fgo-log/v1.0.5/v2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fipfs%2fgo-log/v1.0.5/v2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>ipfs/go-log (github.com/ipfs/go-log)</summary>

### [`v2.5.1`](https://togithub.com/ipfs/go-log/compare/v2.5.0...v2.5.1)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.5.0...v2.5.1)

### [`v2.5.0`](https://togithub.com/ipfs/go-log/releases/tag/v2.5.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.4.0...v2.5.0)

#### What's Changed

- update go.uber.org/zap to v1.19.1 by
[@&#8203;marten-seemann](https://togithub.com/marten-seemann) in
[ipfs/go-log#130
- Config inspection by
[@&#8203;elijaharita](https://togithub.com/elijaharita) in
[ipfs/go-log#129

#### New Contributors

- [@&#8203;elijaharita](https://togithub.com/elijaharita) made their
first contribution in
[ipfs/go-log#129

**Full Changelog**:
ipfs/go-log@v2.4.0...v2.5.0

### [`v2.4.0`](https://togithub.com/ipfs/go-log/releases/tag/v2.4.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.3.0...v2.4.0)

#### What's Changed

- In addition to StdOut/Err check the outfile for TTYness by
[@&#8203;ribasushi](https://togithub.com/ribasushi) in
[ipfs/go-log#117
- Add WithStacktrace untility by
[@&#8203;Kubuxu](https://togithub.com/Kubuxu) in
[ipfs/go-log#118
- sync: update CI config files by
[@&#8203;web3-bot](https://togithub.com/web3-bot) in
[ipfs/go-log#119
- Document environment variables by
[@&#8203;Stebalien](https://togithub.com/Stebalien) in
[ipfs/go-log#120
- fix: cannot call SetPrimaryCore after using a Tee logger by
[@&#8203;moul](https://togithub.com/moul) in
[ipfs/go-log#121
- update mattn/go-isatty to v0.0.14 by
[@&#8203;marten-seemann](https://togithub.com/marten-seemann) in
[ipfs/go-log#123

#### New Contributors

- [@&#8203;moul](https://togithub.com/moul) made their first
contribution in
[ipfs/go-log#121

**Full Changelog**:
ipfs/go-log@v2.3.0...v2.4.0

### [`v2.3.0`](https://togithub.com/ipfs/go-log/releases/tag/v2.3.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.2.0...v2.3.0)

Features:

- Do not output ANSI-color sequences unless one of the outputs is a TTY.
- New format type `GOLOG_LOG_FMT=color` for cases when capturing color
in a file is desirable

### [`v2.2.0`](https://togithub.com/ipfs/go-log/compare/v2.1.3...v2.2.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.1.3...v2.2.0)

### [`v2.1.3`](https://togithub.com/ipfs/go-log/releases/tag/v2.1.3)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.1.2...v2.1.3)

Update deps.

### [`v2.1.2`](https://togithub.com/ipfs/go-log/compare/v2.1.1...v2.1.2)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.1.1...v2.1.2)

### [`v2.1.1`](https://togithub.com/ipfs/go-log/releases/tag/v2.1.1)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.1.0...v2.1.1)

This patch release fixes an issue where setting the log level of a
subsystem to anything below error at runtime wouldn't have any effect.

### [`v2.1.0`](https://togithub.com/ipfs/go-log/releases/tag/v2.1.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.8...v2.1.0)

This release:

1. Adds support for *subscribing* to log events by calling
`NewPipeReader`.
2.  Won't log to stderr if GOLOG_FILE has been specified.
3. Allows re-configuring the logging subsystem at runtime by calling
`SetupLogging`.

### [`v2.0.8`](https://togithub.com/ipfs/go-log/releases/tag/v2.0.8)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.7...v2.0.8)

Fixes the Warningf implementation introduced in v2.0.7 to actually skip
a level and not log error messages all over the place.

### [`v2.0.7`](https://togithub.com/ipfs/go-log/compare/v2.0.6...v2.0.7)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.6...v2.0.7)

### [`v2.0.6`](https://togithub.com/ipfs/go-log/releases/tag/v2.0.6)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.5...v2.0.6)

Add back pre-deprecated Warning and Warningf functions so this logger
can be used by libraries like badger that expect such functions.

### [`v2.0.5`](https://togithub.com/ipfs/go-log/releases/tag/v2.0.5)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.4...v2.0.5)

Update zap and remove unnecessary deps.

### [`v2.0.4`](https://togithub.com/ipfs/go-log/compare/v2.0.3...v2.0.4)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.3...v2.0.4)

### [`v2.0.3`](https://togithub.com/ipfs/go-log/compare/v2.0.2...v2.0.3)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.2...v2.0.3)

### [`v2.0.2`](https://togithub.com/ipfs/go-log/compare/v2.0.1...v2.0.2)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.1...v2.0.2)

### [`v2.0.1`](https://togithub.com/ipfs/go-log/compare/v2.0.0...v2.0.1)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.0...v2.0.1)

### [`v2.0.0`](https://togithub.com/ipfs/go-log/compare/v1.0.5...v2.0.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v1.0.5...v2.0.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 11pm every weekday,before 7am
every weekday,every weekend" in timezone Europe/Brussels, Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/kairos-io/provider-kairos).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy45My4xIiwidXBkYXRlZEluVmVyIjoiMzcuMzAxLjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
github-actions bot pushed a commit to kairos-io/provider-kairos that referenced this pull request May 1, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/ipfs/go-log](https://togithub.com/ipfs/go-log) | `v1.0.5`
-> `v2.5.1` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fipfs%2fgo-log/v2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fipfs%2fgo-log/v2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fipfs%2fgo-log/v1.0.5/v2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fipfs%2fgo-log/v1.0.5/v2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>ipfs/go-log (github.com/ipfs/go-log)</summary>

### [`v2.5.1`](https://togithub.com/ipfs/go-log/compare/v2.5.0...v2.5.1)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.5.0...v2.5.1)

### [`v2.5.0`](https://togithub.com/ipfs/go-log/releases/tag/v2.5.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.4.0...v2.5.0)

#### What's Changed

- update go.uber.org/zap to v1.19.1 by
[@&#8203;marten-seemann](https://togithub.com/marten-seemann) in
[ipfs/go-log#130
- Config inspection by
[@&#8203;elijaharita](https://togithub.com/elijaharita) in
[ipfs/go-log#129

#### New Contributors

- [@&#8203;elijaharita](https://togithub.com/elijaharita) made their
first contribution in
[ipfs/go-log#129

**Full Changelog**:
ipfs/go-log@v2.4.0...v2.5.0

### [`v2.4.0`](https://togithub.com/ipfs/go-log/releases/tag/v2.4.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.3.0...v2.4.0)

#### What's Changed

- In addition to StdOut/Err check the outfile for TTYness by
[@&#8203;ribasushi](https://togithub.com/ribasushi) in
[ipfs/go-log#117
- Add WithStacktrace untility by
[@&#8203;Kubuxu](https://togithub.com/Kubuxu) in
[ipfs/go-log#118
- sync: update CI config files by
[@&#8203;web3-bot](https://togithub.com/web3-bot) in
[ipfs/go-log#119
- Document environment variables by
[@&#8203;Stebalien](https://togithub.com/Stebalien) in
[ipfs/go-log#120
- fix: cannot call SetPrimaryCore after using a Tee logger by
[@&#8203;moul](https://togithub.com/moul) in
[ipfs/go-log#121
- update mattn/go-isatty to v0.0.14 by
[@&#8203;marten-seemann](https://togithub.com/marten-seemann) in
[ipfs/go-log#123

#### New Contributors

- [@&#8203;moul](https://togithub.com/moul) made their first
contribution in
[ipfs/go-log#121

**Full Changelog**:
ipfs/go-log@v2.3.0...v2.4.0

### [`v2.3.0`](https://togithub.com/ipfs/go-log/releases/tag/v2.3.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.2.0...v2.3.0)

Features:

- Do not output ANSI-color sequences unless one of the outputs is a TTY.
- New format type `GOLOG_LOG_FMT=color` for cases when capturing color
in a file is desirable

### [`v2.2.0`](https://togithub.com/ipfs/go-log/compare/v2.1.3...v2.2.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.1.3...v2.2.0)

### [`v2.1.3`](https://togithub.com/ipfs/go-log/releases/tag/v2.1.3)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.1.2...v2.1.3)

Update deps.

### [`v2.1.2`](https://togithub.com/ipfs/go-log/compare/v2.1.1...v2.1.2)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.1.1...v2.1.2)

### [`v2.1.1`](https://togithub.com/ipfs/go-log/releases/tag/v2.1.1)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.1.0...v2.1.1)

This patch release fixes an issue where setting the log level of a
subsystem to anything below error at runtime wouldn't have any effect.

### [`v2.1.0`](https://togithub.com/ipfs/go-log/releases/tag/v2.1.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.8...v2.1.0)

This release:

1. Adds support for *subscribing* to log events by calling
`NewPipeReader`.
2.  Won't log to stderr if GOLOG_FILE has been specified.
3. Allows re-configuring the logging subsystem at runtime by calling
`SetupLogging`.

### [`v2.0.8`](https://togithub.com/ipfs/go-log/releases/tag/v2.0.8)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.7...v2.0.8)

Fixes the Warningf implementation introduced in v2.0.7 to actually skip
a level and not log error messages all over the place.

### [`v2.0.7`](https://togithub.com/ipfs/go-log/compare/v2.0.6...v2.0.7)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.6...v2.0.7)

### [`v2.0.6`](https://togithub.com/ipfs/go-log/releases/tag/v2.0.6)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.5...v2.0.6)

Add back pre-deprecated Warning and Warningf functions so this logger
can be used by libraries like badger that expect such functions.

### [`v2.0.5`](https://togithub.com/ipfs/go-log/releases/tag/v2.0.5)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.4...v2.0.5)

Update zap and remove unnecessary deps.

### [`v2.0.4`](https://togithub.com/ipfs/go-log/compare/v2.0.3...v2.0.4)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.3...v2.0.4)

### [`v2.0.3`](https://togithub.com/ipfs/go-log/compare/v2.0.2...v2.0.3)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.2...v2.0.3)

### [`v2.0.2`](https://togithub.com/ipfs/go-log/compare/v2.0.1...v2.0.2)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.1...v2.0.2)

### [`v2.0.1`](https://togithub.com/ipfs/go-log/compare/v2.0.0...v2.0.1)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v2.0.0...v2.0.1)

### [`v2.0.0`](https://togithub.com/ipfs/go-log/compare/v1.0.5...v2.0.0)

[Compare
Source](https://togithub.com/ipfs/go-log/compare/v1.0.5...v2.0.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 11pm every weekday,before 7am
every weekday,every weekend" in timezone Europe/Brussels, Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/kairos-io/provider-kairos).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMDEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjMwMS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

None yet

3 participants