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

Optional Try Runtime Logging #7010

Open
2 tasks done
AurevoirXavier opened this issue Dec 27, 2024 · 3 comments · May be fixed by #7021
Open
2 tasks done

Optional Try Runtime Logging #7010

AurevoirXavier opened this issue Dec 27, 2024 · 3 comments · May be fixed by #7021
Labels
I5-enhancement An additional feature request.

Comments

@AurevoirXavier
Copy link
Contributor

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Motivation

No response

Request

Make such log

let mut sp = Spinner::with_timer(Spinners::Dots, "Scraping keys...".into());
optional.

The log looks good in terminal. But if we redirect it to a file. It becomes a disaster.

Solution

No response

Are you willing to help with this request?

Yes!, Maybe (please elaborate above)

@AurevoirXavier AurevoirXavier added the I5-enhancement An additional feature request. label Dec 27, 2024
@AurevoirXavier AurevoirXavier changed the title Optional Logging Optional Try Runtime Logging Dec 27, 2024
@bkchr
Copy link
Member

bkchr commented Dec 27, 2024

Sounds reasonable. We should probably detect if StdErr is a terminal and if not, not even initialize the spinner.

@AurevoirXavier can you do this? This should be useful here.

@AurevoirXavier
Copy link
Contributor Author

@AurevoirXavier can you do this? This should be useful here.

Great! I'll work on this.

@AurevoirXavier
Copy link
Contributor Author

AurevoirXavier commented Dec 27, 2024

https://www.reddit.com/r/programming/comments/41u5hw/what_is_the_exact_difference_between_a_terminal_a/

I'm wondering should we use is_tty or is_terminal?

https://github.com/softprops/atty

Okay, let's go is_terminal.

@AurevoirXavier AurevoirXavier linked a pull request Dec 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants