fix: stop creating root.log on autoarray import#285
Merged
Conversation
Remove the FileHandler with filename root.log from autoarray's packaged logging.yaml (and the test config mirror). It attached to the root logger unconditionally, dropping a root.log into cwd whenever a script imported autoarray from a directory whose own config/logging.yaml did not override this one (e.g. running from a repo root rather than a workspace dir). Console logging via StreamHandler is unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Collaborator
Author
Smoke Test Results — 2026-04-18
28 / 32 passed. All 4 failures are missing committed FITS datasets ( Failures (pre-existing, unrelated)
|
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.
Summary
Removes the
FileHandler(withfilename: root.log) from the packagedautoarray/config/logging.yamland its test-config mirror. The handler was attached to the root logger unconditionally, so importingautoarrayfrom a cwd whose ownconfig/logging.yamldid not override it (e.g. a bare repo root) caused aroot.logfile to be dropped into that cwd. ConsoleStreamHandlerlogging is unchanged.Reproduction (before the fix):
cd <any dir without config/logging.yaml> && python -c "import autoarray"→ an emptyroot.logappears. After the fix the root logger has only aStreamHandlerand no file is written.API Changes
None — internal configuration change only. No public Python symbols are affected.
See full details below.
Test Plan
pytest test_autoarray/ -x→ 732 passedpython -c "import autoarray; import logging; print([type(h).__name__ for h in logging.getLogger().handlers])"reports['StreamHandler']only, and noroot.logis written.autofit_workspace/: behaviour unchanged (workspacelogging.yamlalready won before; still wins now).Full API Changes (for automation & release notes)
Removed
Added
Changed Behaviour
autoarrayno longer attaches alogging.FileHandlerwriting toroot.login cwd. Users who relied on this implicit file log must now configure their ownFileHandlerin their workspaceconfig/logging.yaml.Migration
filehandler to their ownconfig/logging.yamland include it underroot.handlers.🤖 Generated with Claude Code