Sub logging support to fancylog#93
Open
HARSHDIPSAHA wants to merge 6 commits intoneuroinformatics-unit:mainfrom
Open
Sub logging support to fancylog#93HARSHDIPSAHA wants to merge 6 commits intoneuroinformatics-unit:mainfrom
HARSHDIPSAHA wants to merge 6 commits intoneuroinformatics-unit:mainfrom
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Author
example useimport fancylog
from fancylog.sublog import sub_log
fancylog.start_logging(output_dir, fancylog, logger_name="pipeline")
with sub_log("registration", output_dir, parent_logger_name="pipeline") as sl:
sl.logger.info("Starting atlas registration")
sl.run_subprocess(["niftyreg", "-ref", "atlas.nii", "-flo", "brain.nii"])Example output
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #93 +/- ##
==========================================
+ Coverage 77.72% 80.35% +2.63%
==========================================
Files 3 4 +1
Lines 211 280 +69
==========================================
+ Hits 164 225 +61
- Misses 47 55 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Before submitting a pull request (PR), please read the contributing guide.
Please fill out as much of this template as you can, but if you have any problems or questions, just leave a comment and we will help out :)
Description
What is this PR
Why is this PR needed?
Introduce sublogging.
What does this PR do?
This pr adds a sublog feature whose parent will a main logger to consistently and easy manage and analyse loggings in heirarchial form.
adds
SubLogand thesub_logcontext manager to fancylog, addressing both parts of the feature request:References
#66
How has this PR been tested?
using pytest on added tests.
Is this a breaking change?
No
Does this PR require an update to the documentation?
Maybe
Checklist: