Skip to content

feat: always save log file on error#142

Merged
neuronflow merged 2 commits into
mainfrom
feat/improve-logs-on-error
May 12, 2026
Merged

feat: always save log file on error#142
neuronflow merged 2 commits into
mainfrom
feat/improve-logs-on-error

Conversation

@MarcelRosier
Copy link
Copy Markdown
Collaborator

@MarcelRosier MarcelRosier commented May 10, 2026

Addressing #139

Copilot AI review requested due to automatic review settings May 10, 2026 11:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automatic temporary log-file creation to inference runs and ensures the log is preserved when inference fails, improving debuggability without requiring users to explicitly pass a log_file.

Changes:

  • InferenceSetup now always attaches a log file handler; when log_file is not provided it creates a temporary brats_*.log, deletes it on success, and preserves it (printing its path to stderr) on error.
  • Adds/updates unit tests to verify temp-log cleanup on success and preservation on failure.
  • Improves container error visibility by printing container output to stderr and updating the raised exception message.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
tests/utils/test_data_handling.py Adds tests asserting temp-log cleanup on success and preservation on error.
brats/utils/data_handling.py Implements automatic temp-log creation and conditional cleanup/preservation in InferenceSetup.
brats/core/docker.py Prints container failure output to stderr and updates the exception guidance message.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread brats/utils/data_handling.py Outdated
Comment thread brats/core/docker.py Outdated
Comment thread tests/utils/test_data_handling.py Outdated
Comment thread tests/utils/test_data_handling.py Outdated
@MarcelRosier MarcelRosier requested a review from neuronflow May 10, 2026 11:51
@neuronflow neuronflow requested a review from PaulaTBz May 11, 2026 08:42
Copy link
Copy Markdown
Collaborator

@PaulaTBz PaulaTBz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feature exactly tackles the problem of the related issue and provides robust logging that requires no action from the user, which makes it very convenient in the case of failure and greatly improves logging

@neuronflow neuronflow merged commit 222b040 into main May 12, 2026
7 checks passed
@neuronflow neuronflow deleted the feat/improve-logs-on-error branch May 12, 2026 10:33
@neuronflow neuronflow linked an issue May 28, 2026 that may be closed by this pull request
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.

[FEATURE] Automatically save logs in case of failure

4 participants