Change prints into logging