Log to file also when not started from terminal #1396
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To capture logs into a file we redirect stdout and stdin to a log file, but this is currently only done if stdout or stdin are tty's. Whenever eww is started from a background task, that is not directly from a terminal, stdout and stdin aren't tty's and nothing is written to the log files as a result.
I see no reason to require stdout and stdin to be ttys and I don't see any other checks that would make sense instead, so just remove the isatty checks for stdout and stdin, and just always redirect them.
Additional Notes
I'm not sure why this check was in place. It has been there for quite some time and it bugged me that I only got log output once I manually restarted eww.
Checklist
Please make sure you can check all the boxes that apply to this PR.
cargo fmtto automatically format all code before committing