Add a logger and toString methods.