logging: include file name suffixes in XLOG() category names
[folly.git] / folly / experimental / logging / xlog.cpp
index 42e25649d9533576f36a10a94b8975171f654196..868021160f818d015e1c8f16a98c46b9bb933d5a 100644 (file)
@@ -69,20 +69,12 @@ std::string getXlogCategoryNameForFile(StringPiece filename) {
 
   // Translate slashes to dots, to turn the directory layout into
   // a category hierarchy.
-  size_t lastDot = std::string::npos;
   for (size_t n = 0; n < categoryName.size(); ++n) {
     if (categoryName[n] == '/') {
       categoryName[n] = '.';
-      lastDot = std::string::npos;
-    } else if (categoryName[n] == '.') {
-      lastDot = n;
     }
   }
 
-  // Strip off the filename extension, if one was present.
-  if (lastDot != std::string::npos) {
-    categoryName.resize(lastDot);
-  }
   return categoryName;
 }
 
@@ -132,4 +124,4 @@ LogLevel XlogLevelInfo<false>::loadLevelFull(
 // compiled or not.
 template class XlogLevelInfo<true>;
 template class XlogCategoryInfo<true>;
-}
+} // namespace folly