Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For log file open with full share access, if user sets "HARMONY_LOG_FILE" append obsolete to old FileLog #83

Merged
merged 2 commits into from
Sep 5, 2023

Conversation

mitchcapper
Copy link
Contributor

This fixes two issues:

  • By default we open log files with 0 share access, this means you can't even tail the file from an external process, this changes it to full share so one could even remove it while open (win will not actually delete until we release the handle though).

  • If the user sets the log file using HARMONY_LOG_FILE env var and makes any calls to the FileLog handler, this was a guaranteed crash due to the prior locking issue. Even though this will now fix the lock issue the obsolete handler would likely still cause issues as StreamWriter doesn't really expect others to write the file while its using it.

unrelated, the upstream harmony always appends the log file, vs HarmonyX which truncates on each start. I prefer the HX behavior but wanted to note the difference.

Harmony/Tools/Logger.cs Outdated Show resolved Hide resolved
@ManlyMarco ManlyMarco merged commit e457977 into BepInEx:master Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants