报错信息:
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); }