implement logging for the optimizers

not the scipy optimizers