-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): provide human readable reporting in console output #567
Conversation
530853a
to
178e4d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool, and it can/should be merged!
I will use it as my default branch over the coming days to see if anything breaks. I think I've seen a division by zero earlier, probably a good thing to write some tests thinking about unhappy paths. |
Instead of just restricting the default log level, it'd make sens to write a log file next to the extraction with a bit higher verbosity. I'd keep the console as clear as possible. My dream is to add some more intelligible progress reporting to the console via |
How would you do it ?
Me too ! |
Okay, maybe I've missed something, but it seems like it is really not obvious how to do with structlog... |
7807d84
to
98ebddb
Compare
I introduced logging to a file and a progress bar using The progress bar runs in the main thread and updates the total and completed value based on submitted and completed tasks of the worker pool. Yes, the progress bar can go back but that's how it is. We can't predict what we will encounter down the extraction directory. There are a few open UI/UX questions:
|
de81242
to
2f5e41a
Compare
If we route |
d3058bf
to
8365ebf
Compare
2edcffd
to
1687d18
Compare
Provide some information about identified chunks, extracted content, and encountered errors. All the information is obtained from the ProcessResult object. Example: ---- poetry run unblob --report /tmp/report.json -f -e /tmp/out sample.img Extracted files: 3616 Extracted directories: 609 Extracted links: 782 Extraction directory size: 298.19 MB. Chunks identification ratio: 90.74% Chunks distribution - EXTFS: 150.00 MB (54.17%) - ELF32: 73.98 MB (26.72%) - UNKNOWN: 25.64 MB (9.26%) - FAT: 16.00 MB (5.78%) - LZO: 9.28 MB (3.35%) - XZ: 1.03 MB (0.37%) - TAR: 860.00 KB (0.30%) - BZIP2: 93.56 KB (0.03%) - GZIP: 24.21 KB (0.01%) Encountered errors: 1 - Severity.WARNING: MaliciousSymlinkRemoved ----
1687d18
to
8869590
Compare
Provide some information about identified chunks, extracted content, and encountered errors. All the information is obtained from the ProcessResult object.
Example:
This code was sitting on my machine for the last month. I figured I would push it to start a discussion 😄