replace print with log