Replace console with logger