cleanup whitespace and stray console.logs
only create timestamps if not supplied