Complete log parsing for both cases and clean up debug statements