Replaced NSLog with printf.