Update logging to avoid warnings with fprintf