Log Flushing
Closed this issue · 2 comments
cancan101 commented
This block:
if log_file:
h.flush()
h.close()
should probably appear in a finally clause rather than at each return point. Also is that even needed? Seems pretty paranoid and oddly special cased for just the log_file
case.
jeffmax commented
I agree on the finally close, I will update when I have a chance, feel free to submit a pull request. As for whether it is needed or not, I guess I erred on the side of caution.
jeffmax commented
This has been abstracted out into a function by @blakedewey.