-
Notifications
You must be signed in to change notification settings - Fork 49
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
Log #5
Comments
I will consider adding it in a future version. I am quite busy right now, so if someone reading this is willing to contribute I may accept a pull request as long as it does not break existing funtionality. |
We may can do something like this with pythons import logging
import sys
configured_handlers = [logging.FileHandler(args.log_file), logging.StreamHandler(sys.stdout)]
logging.basicConfig(level=logging.INFO, format="%(message)s", handlers=configured_handlers) This will log to |
I agree about using the standard library's I would keep logging and screen output as separate operations, since the features needed tend to be a bit different in each case. With regards to logging, I think we should have the ability to specify the file path and, either now or in a future update, a few customisation options. For instance: 1. Default (full) reportWrite the full report (files, size changes, summary and errors, similar to what we are already printing to screen) to the specified file:
2. Errors logWrite a smaller report including just any errors found to the specified file:
3. Processed files logWrite a smaller report including the list of all processed (i.e. modified) images paths (one file path per line, without further details, in order to allow integration with other tools) to the specified file:
By keeping these options separate, we can implement it one at a time, but do it in a way that makes it easy to add the other options. Also, it would allow the user to combine those options in a single command, for instance, getting an error log and a processed files list (or even the 3 kinds of reports, if needed), in separate files:
What do you think? |
But this is something different, isnt it? From my understanding, you're talking about a to save what happend (reporting), not redirecting the output on the screen to a file (logging). Don't get me wrong, I don't want to do nitpicking here, just want to be clear what the desired outcome should be. That said, I agree and like the idea to have a reporting interface (maybe a simple csv file would work?) to have the ability for further post-processing the results. For this we probably don't need to have the Let me know what you think :) |
Right. I try to envision the project as a whole, in order to come up with an implementation strategy that fits the needs not only of a single issue, but for a number of common use cases. It is indeed a different feature, while vaguely related. I can see how a csv (or json or other structured format) could be useful. But I would let those to a later stage, as format options for the report or log files. Right now, I would start with the approach I described above. I believe the |
Hi
Can a option be added to create a log file for the optimized images.
The text was updated successfully, but these errors were encountered: