Made some changes to logging (csv support)