logging: reduce the amount of code emitted for log statements
[folly.git] / folly / experimental / logging / test / XlogTest.cpp
index 4cca9fafd3aa19e646d510e1477ff5a836a06372..32e9643891ef9edba4ec981d7f90e085da0d7b62 100644 (file)
@@ -22,6 +22,7 @@
 #include <folly/experimental/logging/test/XlogHeader2.h>
 #include <folly/experimental/logging/xlog.h>
 #include <folly/portability/GTest.h>
+#include <folly/test/TestUtils.h>
 
 using namespace folly;
 using std::make_shared;
@@ -35,6 +36,11 @@ XLOG_SET_CATEGORY_NAME("xlog_test.main_file");
 // settings for the entire program.  Fortunately all of the other unit tests do
 // use testing LoggerDB objects.
 
+TEST(Xlog, xlogName) {
+  EXPECT_EQ("xlog_test.main_file", XLOG_GET_CATEGORY_NAME());
+  EXPECT_EQ("xlog_test.main_file", XLOG_GET_CATEGORY()->getName());
+}
+
 TEST(Xlog, xlog) {
   auto handler = make_shared<TestLogHandler>();
   LoggerDB::get()->getCategory("xlog_test")->addHandler(handler);