Skip to content
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

Option to keep log files #400

Open
porg opened this issue Nov 24, 2022 · 0 comments
Open

Option to keep log files #400

porg opened this issue Nov 24, 2022 · 0 comments

Comments

@porg
Copy link

porg commented Nov 24, 2022

I'm proposing an option to keep log files

  • Off by default. Data-scarcity (privacy) first! You have to opt in.

If enabled ImageOptim creates a log file pair on each run

  • ImageOptim <date-time-stamp> batch.tsv lists the batch options and its performance: Duration, bytes and percentage saved, etc.
  • ImageOptim <date-time-stamp> files.tsv lists all the processed files and how they individually performed. A TSV representation of the output window as it now it.
  • This segregation allows you to quickly filter in the log folder for only the one or the other.
    • Sometimes your focus maybe is more "on a file level" other times more on a "batch as a whole" level.
    • That segregation supports this and it keeps the TSV file and parsing absolutely simplistic and maximum compatible.

User motivation

  • Learning/Optimizing from concrete "body of work": Which options yield which results at what effort.
  • Project Management: Keep track of which processing operations you did on which files when. Can help to keep track when dealing with hundreds/thousands of files. Possible as one part of larger multi stage processing of image files.

Menu gets slightly restructured command names & shortcuts

Menu > File gets these command changed/integrated

Show me log folder      ⇧ ⌘ L

On each manual batch invocation ImageOptim creates logs automatically in its log folder:

~/Library/Logs/ImageOptim/
  ImageOptim 2022-11-24 11-05-07 batch.tsv
  ImageOptim 2022-11-24 11-05-07 files.tsv
  ImageOptim 2022-11-23 17-20-36 batch.tsv
  ImageOptim 2022-11-23 21-08-03 files.tsv
  ...

Menu > File > Show me log folder opens that folder in Finder.

The TAB separated output format

batch.tsv

ImageOptim	1.8.8
Start	2022-11-24 11:05:07
End	2022-11-24 11:25:17
Duration	20:10.234
CPU runtime	17:20.567
Engines used	OxyPNG, AdvPNG, PNGCrush
Strip metadata	--
Level	7 Insane
Quality	100
Files	220
Total Bytes Original	200.000.000
Total Bytes Optimized	180.000.000
Total Bytes Saved	20.000.000
Percent Saved	10%
Percent Saved Mean	9%
Percent Saved Max	31%

files.tsv

Status	File	Original Size	Optimized Size	Saving
	/path/to/file one.png	400000	360000	10.00%
	/path/to/file two.png	2000000	1600000	20.00%
	/path/to/file perfectly optimized.png	30000	30000	0.00%

Preferences

[ ] Keep log files

  • Integrated at appropriate place

UI Integration

ImageOptim logging 1 - Results window with summary and button - Show full log

  • After each run ImageOptim shows a stats summary in its bottom bar:

     Saved 20,1 MB out of 197,1 MB. 9,5 % per file on average (up to 57,8 %)
    
  • Next to this summary we now have a button [ Show full log ]

    • If logging is disabled then the button label is [ Keep log files… ]
  • Clicking [ Keep log files… ] opens Preferences and focuses that specific preference.

    • Now a new user has learned where to enable/disable this
    • And can decide now whether to keep logs in general or not.
  • Clicking [ Show full log ] effectively triggers the classical "Reveal in Finder" command. So it opens the parent folder ~/Library/Logs/ImageOptim/ in a Finder window and in that window selects the current *batch.tsv file.

ImageOptim logging 2 - Show full log opens log folder and selects log file

  • From here it is just the press of
    • ⌘↓ to open the file with its default handler app like Apple Numbers
      • SPACE to get a nice QuickLook with an excellent plugin like quicklook-csv

ImageOptim logging 3a - Batch TSV file in QuickLookCSV

ImageOptim logging 3b - Files TSV file in QuickLookCSV

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

No branches or pull requests

1 participant