Closed danhuaxu closed 2 years ago
More details could be helpful here. Is this referring to print statements in the tray launcher itself or scripts it runs?
I think the tray launcher itself should not use print
typically. I think it should use the logging
module.
I am referring to print
in scripts it runs.
Yes, the tray launcher itself is using logging to record things.
I see. I am not sure if there is an easy solution to this problem. This is likely not an very important thing to solve now - the idea of tray launcher is that the user does not need to look at the terminal (and print statements). Therefore, as long as all prints and errors are saved in the log file when the script exits, which I think is the behavior now, I think this is not an issue for us.
Sounds good. Should I close this issue then?
Yes I think you can close this.
stderr
worked, partially - I raised an OSError and there were error messages in the log file. But when I didprint(..., file=stderr)
, this didn't print to the file.stdout
failed - I had to explicitly add a linesys.stdout.flush()
to get the output into the log file.This seems like a problem back to earlier versions of tray launcher. I haven't tested on all 0.1.x versions, but 0.1.4 certainly had this issue.