Prevented some crashes related to logging on Android
合并original最新提交