print_r was too verbose, let's use toString for logging and exceptions