goatcorp / FFXIVQuickLauncher

Custom launcher for FFXIV
https://goatcorp.github.io/
GNU General Public License v3.0
2.8k stars 325 forks source link

dalamud.log is empty on fresh start #1065

Open Dranni21312 opened 2 years ago

Dranni21312 commented 2 years ago

Update disclaimer

What did you do?

Steps to reproduce:

  1. Delete dalamud.log and dalamud.log.old
  2. Start the game via the launcher
  3. Exit the game

The result is the dalamud.log file created is a zero length file and does not contain any relevant log data.

Subsequent launches of the game facilitate normal logging behavior.

Using the .31 build.

Platform

Windows

Wine/Proton runner version

No response

Relevant log output

No response

goaaats commented 2 years ago

We know about this one, cause unknown

Dranni21312 commented 2 years ago

I don't know much about internals of the plugin, but I took a look at how the file is created in the repository

In Dalamud/Entry point.cs, lines 260 and 261 are as follows:

if (!logFile.Exists)
   logFile.Create();

The FileInfo.Create() call used here creates and opens a FileStream to the file, which is not correctly closed or disposed of, which will in turn leave the file open and can result in this behavior.

This call should be wrapped in a using block or contained within a using statement as follows:

using (logFile.Create());

I don't have an easy way to test if this fixes this behavior, but there's a good chance it might.

Dranni21312 commented 2 years ago

Note: this would also explain this issue happening only during the run when the file is created