]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: fix log warnings 16056/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 1 Jul 2017 07:20:30 +0000 (15:20 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 1 Jul 2017 07:24:22 +0000 (15:24 +0800)
/home/jenkins-build/build/workspace/ceph-pull-requests/src/common/LogEntry.cc:54:24: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses]
   } else if (level_str == "warn" | level_str == "warning") {
                        ^
/home/jenkins-build/build/workspace/ceph-pull-requests/src/common/LogEntry.cc:56:24: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses]
   } else if (level_str == "error" | level_str == "err") {

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/common/LogEntry.cc

index d0d3e93dd2049e7217487fff61c2ae1b94c8256f..d9100fc46a25669ece7450f1c7460a94d19f5833 100644 (file)
@@ -51,9 +51,9 @@ clog_type LogEntry::str_to_level(std::string const &str)
     return CLOG_INFO;
   } else if (level_str == "sec") {
     return CLOG_SEC;
-  } else if (level_str == "warn" | level_str == "warning") {
+  } else if (level_str == "warn" || level_str == "warning") {
     return CLOG_WARN;
-  } else if (level_str == "error" | level_str == "err") {
+  } else if (level_str == "error" || level_str == "err") {
     return CLOG_ERROR;
   } else {
     return CLOG_UNKNOWN;