Make sure to only call -log from the main thread.