WebHost: use canonical LOGS_FOLDER for room logs#6273
Open
patrickwehbe wants to merge 1 commit into
Open
Conversation
Room logs were written and read using three different path computations:
customserver.py wrote under Utils.user_path("logs"), misc.py read from the
implicit relative "logs" (in two places), and WebHostLib defines
LOGS_FOLDER = os.path.relpath("logs"). When the WebHost is run by itself
(self-hosted) these resolve to different directories, so room logs were
written where the readers could not find them.
Reuse the canonical WebHostLib.LOGS_FOLDER in all three places so the writer
and both readers always agree.
Fixes ArchipelagoMW#6046.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this fixing or adding?
Room logs were written and read using three different path computations:
customserver.pywrote them underUtils.user_path("logs")misc.pyread them from the implicit relative"logs"(in two places)WebHostLib/__init__.pydefinesLOGS_FOLDER = os.path.relpath("logs")When the WebHost is run by itself (self-hosted),
user_path("logs")and the relative"logs"resolve to different directories, so room logs were written where the/logviews could not find them.This reuses the canonical
WebHostLib.LOGS_FOLDERin all three places so the writer and both readers always agree. (The issue also suggests making the location configurable inconfig.yamllikeUPLOADS_FOLDER; that is left out here to keep the fix minimal and focused.)Fixes #6046.
How was this tested?
Confirmed
WebHostLib.LOGS_FOLDERresolves to the canonical relativelogspath and thatmisc.pyreferences it after the change; both edited files passpy_compile. The change is otherwise inspection-level, since WebHost log-file routing isn't unit-testable here -- it aligns the single writer (customserver) and the readers (misc) on one constant, which the reporter confirmed fixes self-hosted logging.