Created
May 4, 2012 16:09
-
-
Save de-wim/2595804 to your computer and use it in GitHub Desktop.
CATS parsing magic
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
| Dir['*.log'].each do |fname| | |
| log = Log.parse(fname) | |
| symbol = log.symbols.values.sort_by { |s| -s.charcount }.first | |
| line = log.lines.values.sort_by { |s| -s.charcount }.first | |
| puts "#{log.cats_charcount}/#{log.charcount} in #{log.name}, most offensive: #{symbol.name} (#{symbol.charcount}), #{line.name} (#{line.charcount})" | |
| end | |
| # Output: | |
| # 2169/21484 in regexp-info.log, most offensive: -/legacy/printf (983), -/legacy/printf:0000 (983) | |
| # 212132/227923 in teraterm.log, most offensive: amApp/resmgmt (22885), amApp/resmgmt:0850 (16423) | |
| # 170108/170108 in teraterm_csm_magic_keys.log, most offensive: -/legacy/printf (67248), -/legacy/printf:0000 (67248) | |
| # 522492/525455 in teraterm_newprints.log, most offensive: er/plfpow_merr (183278), er/plfpow_merr:0356 (182851) | |
| # 38928017/39752024 in zzz_hbbtv_CATS_crash.log, most offensive: -/legacy/printf (7015982), -/legacy/printf:0000 (7015568) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment