Pidgeot / python-lnp

Cross-platform re-implementation of the Lazy Newb Pack launcher.
ISC License
64 stars 10 forks source link

Delete empty stderr.txt, stdout.txt on exit #110

Closed Pidgeot closed 4 years ago

Pidgeot commented 4 years ago

Simple enough - empty files convey no useful information, and this way error logs are less likely to be overlooked out of familiarity.

[Issue created by PeridexisErrant: 2016-01-18] [Last updated on bitbucket: 2016-03-14]

[Comment created by Pidgeot: 2016-03-14] Removing milestone: 0.11 (automated comment)

[Comment created by Pidgeot: 2016-01-21] Don't create empty logfiles

Waiting to create stderr.txt (etc) until something is being written makes users pay more attention to logs, and avoids overwriting simply by restarting PyLNP.

Closes issue #108

→ <>

[Comment created by PeridexisErrant: 2016-01-19] Sounds like the right way to me. One moment...

[Comment created by Pidgeot: 2016-01-18] Perhaps it would be better to not even create them if they're not being used? That will leave the most recent "useful" log in the directory, even if the program is run many times after that (using "useful" to mean "non-empty"). It also works in case of non-standard termination.

It'd be a very simple implementation: just move the "if not self.outfile:" part from errorlog.redirect to errorlog.write.