浏览代码

Handle invalid `Log::Class`

Add a case of `Log::Class::Count` to the switch statement that
dispatches on `Log::Class`.  The case simply calls the `UNREACHABLE`
macro.
Benjamin Barenblat 11 年之前
父节点
当前提交
7cd5a653ff
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/common/logging/backend.cpp

+ 2 - 1
src/common/logging/backend.cpp

@@ -66,8 +66,9 @@ const char* GetLogClassName(Class log_class) {
         ALL_LOG_CLASSES()
 #undef CLS
 #undef SUB
+        case Class::Count:
+            UNREACHABLE();
     }
-    return "Unknown";
 }
 
 const char* GetLevelName(Level log_level) {