rewrite logging to use objects instead of arrays