Closed clwluvw closed 3 months ago
This doesn't look correct. The check requires the isatty
attribute to exist to call it. If I remember correctly, it may not exist on Windows, hence the check. With your change, if the attribute does not exist, you call it, which will trigger an exception. And if it exists, you don't really check this is a tty.
@vincentbernat This is now not working inside a docker container. Do you have any alternative way to solve it?
Well, I suppose nowaday, when running daemonized, stderr is set to /dev/null
, so it shouldn't be a problem to write to it even when this is a not tty, so we may just replace toconsole
by not silent
. People can still opt out that with --silent
.
Yeah, that was my first approach as well - but thought maybe better to keep it both. I changed it.
Just do if not silent:
instead.
Done. PTAL.
Log to console either hasattr() or isatty()