React native插件项目iOS中讯飞报错Assertion failed: (severity >= 0 && severity < NUM_SEVERITIES), function SetLogDestination

https://github.com/zphhhhh/react-native-speech-iflytek/issues/36

描述:
[IFlySpeechUtility createUtility:initString]的时候报错:

Assertion failed: (severity >= 0 && severity < NUM_SEVERITIES), function SetLogDestination,
file /Users/samyao/Git/trace/node_modules/react-native/third-party/glog-0.3.4/src/logging.cc, line 595.

解决办法:

 

复制代码
inline void LogDestination::SetLogDestination(LogSeverity severity,
                          const char* base_filename) {
//  assert(severity >= 0 && severity < NUM_SEVERITIES);
    char* base_filename_copy = nullptr;                      //初始化char*类型
    base_filename_copy = const_cast<char*>(base_filename);   //const char*类型转char*类型
    if (severity >= 0 && severity < NUM_SEVERITIES) {
      //
    } else {
      severity = 0;
      base_filename_copy = const_cast<char*>("glogTest");
    }
  // Prevent any subtle race conditions by wrapping a mutex lock around
  // all this stuff.
  MutexLock l(&log_mutex);
  //log_destination(severity)->fileobject_.SetBasename(base_filename);
    log_destination(severity)->fileobject_.SetBasename(base_filename_copy);
    
}
复制代码

 

posted @   野生野鸡码农  阅读(781)  评论(1编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2018-07-20 android反编译
2018-07-20 解决在onCreate()过程中获取View的width和Height为0的4种方法
2018-07-20 android装饰者模式
2018-07-20 android中的适配器模式
点击右上角即可分享
微信分享提示