Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.39k stars 374 forks source link

Lazy initialize TextLog._logWriter #3023

Closed ZakFahey closed 3 months ago

ZakFahey commented 5 months ago

There is an instance of this in SqlLog that's used as a backup, but since the StreamWriter is created in the constructor, the file is created too. This means that you'll get an empty text log created every time a server starts up, even if you have text logs disabled. This is especially problematic when you have a multi-server setup with file write conflicts.