use nslog instead of printf