add polymorphism support to log_repr