FFXIVQuickLauncher icon indicating copy to clipboard operation
FFXIVQuickLauncher copied to clipboard

dalamud.log is empty on fresh start

Open Dranni21312 opened this issue 3 years ago • 3 comments

Update disclaimer

  • [X] Yes, I have checked and my issue is not related to the game updating and plugins not working correctly.

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

Dranni21312 avatar Jul 09 '22 19:07 Dranni21312

We know about this one, cause unknown

goaaats avatar Jul 09 '22 19:07 goaaats

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 avatar Jul 09 '22 19:07 Dranni21312

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

Dranni21312 avatar Jul 09 '22 22:07 Dranni21312