Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds file-based logging for simtools applications to support reproducibility, with an auto-generated default log file in output_path and an optional user-specified --log_file.
Changes:
- Add
setup_logging()/get_log_file()to configure both console and file logging during application startup. - Extend CLI/config plumbing to carry an
application_labeland accept a--log_fileargument. - Update tests and resources to reflect the new logging behavior and a renamed afterpulsing ECSV resource.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
src/simtools/application_control.py |
Adds centralized logging setup and default log-file path generation, integrated into startup_application(). |
src/simtools/configuration/commandline_parser.py |
Adds --log_file CLI argument for explicit log file path configuration. |
src/simtools/configuration/configurator.py |
Ensures application_label is present in config for log file naming. |
src/simtools/testing/log_inspector.py |
Adjusts ignore patterns to reduce false positives from new/changed log output. |
src/simtools/visualization/plot_array_layout.py |
Suppresses adjustText logging noise. |
src/simtools/data_model/metadata_collector.py |
Removes a warning that could add noise to logs. |
tests/unit_tests/test_application_control.py |
Refactors/extends unit tests for logging setup, log-file selection, and redaction. |
tests/resources/plot_single_pe_config_from_ecsv_file.yml |
Updates resource reference to renamed afterpulsing ECSV file. |
tests/resources/Afterpulsing-probability-with-uncertainties.ecsv |
Adds new ECSV resource file. |
docs/changes/2039.feature.md |
Documents the new “log to file” feature. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Contributor
Author
|
@EshitaJoshi - I am not going to fix these to issue reported by SonarQube. I think they make the code more difficult to read and I have started the discussion in DPPS to remove those to criteria. |
Contributor
Author
|
Thank you @EshitaJoshi |
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.




Reproducibility requires (among other things) logging information. Add a new logging stream to a file when running simtools applications.
All simtools logging is automatically written to a log file through the application startup mechanism.
Two options:
output_pathas <tool-name-UTC-datetime.log> file--log_fileas configuration parameter