reformatting query logging stuff to be more legible