zoukankan      html  css  js  c++  java
  • RN项目iOS报错,Assertion failed: (severity >= 0 && severity < NUM_SEVERITIES)

    报错信息:

    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);
        
    }
  • 相关阅读:
    11.22
    python之字典(dict)
    Version Control
    java_实现一个类只能声明一个对象
    javase-位运算符
    javase-整数变量的交换
    URI和URL的关系与区别
    http解析
    函数式语言
    MyIASM和Innodb引擎详解
  • 原文地址:https://www.cnblogs.com/Oldz/p/13452607.html
Copyright © 2011-2022 走看看