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

Fix stderr color dependence on stdout #91

Merged
merged 2 commits into from Apr 30, 2024
Merged

Conversation

spoutn1k
Copy link
Contributor

Hello,

I work with programs that pipe stdout often. simple_logger would simply not print colored output to stderr when that happened. This is due to this colored issue.

This PR aims to fix this by implementing a variation of the set_up_color_terminal function, enabled when the stderr feature is selected on other platforms than Windows (For lack of testing environment).

@spoutn1k
Copy link
Contributor Author

I renamed the references to the coloring feature from colored to colors as is defined here:

[features]
default = ["colors", "timestamps"]
colors = ["colored"]

That may be a mistake please let me know if I should roll that back.

@borntyping
Copy link
Owner

Thanks! I think this will fix #71 too.

I renamed the references to the coloring feature from colored to colors as is defined here

I think this change makes sense, I'm not really sure why it was written that way, since coloured is a dependency not a feature.

There's some documentation around set_up_color_terminal in the README that will need updating. (I'll do it when I merge and release this—hopefully later today or this week—if you don't get there first!)

@borntyping borntyping merged commit 4c461f7 into borntyping:main Apr 30, 2024
15 checks passed
@borntyping
Copy link
Owner

Released in 5.0.0.

mergify bot pushed a commit to andrzejressel/pulumi-wasm that referenced this pull request Apr 30, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [simple_logger](https://togithub.com/borntyping/rust-simple_logger) | workspace.dependencies | major | `4.3.3` -> `5.0.0` |

---

### Release Notes

<details>
<summary>borntyping/rust-simple_logger (simple_logger)</summary>

### [`v5.0.0`](https://togithub.com/borntyping/rust-simple_logger/releases/tag/v5.0.0)

[Compare Source](https://togithub.com/borntyping/rust-simple_logger/compare/v4.3.3...v5.0.0)

#### What's Changed

-   Fix stderr color dependence on stdout by [@&#8203;spoutn1k](https://togithub.com/spoutn1k) in [borntyping/rust-simple_logger#91
    -   When using the `stderr` and `colors` features, logs will be printed in colour even when STDOUT is redirected.
    -   Fixes [#&#8203;71](https://togithub.com/borntyping/rust-simple_logger/issues/71).
    -   This also cleans up the feature names used in the code. All references should now be to the `colors` feature, not the `colored` dependency.
-   Removed `set_up_color_terminal` from the public API. This has been called by `init()` for a while now.

#### New Contributors

-   [@&#8203;spoutn1k](https://togithub.com/spoutn1k) made their first contribution in [borntyping/rust-simple_logger#91

**Full Changelog**: borntyping/rust-simple_logger@v4.3.3...v5.0.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), 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.

---

 - [ ] 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/andrzejressel/pulumi-wasm).
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

2 participants