(n.b.: I can't post links yet, sorry for the extra Googling!)
Pet Accuracy Recorder is good for this in particular. It's available on Curse.
As for writing an addon, there's a handful of PET_BATTLE events, the most relevant for a Recount-alike being CHAT_MSG_PET_BATTLE_ COMBAT_LOG. Unfortunately it looks like this returns the verbatim log message without splitting it up into more specific fields like the regular combat log does (e.g.: ability name, damage type, damage amount, crit or not, etc.) So you'd have to parse that yourself and your addon would be subject to the whims of the actual combat log text changing and localization trouble.