logging: add a LogHandler::getConfig() method
[folly.git] / folly / experimental / logging / test / StandardLogHandlerTest.cpp
index 2c9a65b57dd3422ee20138e1f900a9660d18b22b..8fcdf3da5f6bb39fe410c0d0c54724dd9bdb59d3 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#include <folly/experimental/logging/StandardLogHandler.h>
+
 #include <folly/Conv.h>
 #include <folly/experimental/logging/LogCategory.h>
 #include <folly/experimental/logging/LogFormatter.h>
+#include <folly/experimental/logging/LogHandlerConfig.h>
 #include <folly/experimental/logging/LogLevel.h>
 #include <folly/experimental/logging/LogMessage.h>
 #include <folly/experimental/logging/LogWriter.h>
 #include <folly/experimental/logging/LoggerDB.h>
-#include <folly/experimental/logging/StandardLogHandler.h>
 #include <folly/portability/GTest.h>
 
 using namespace folly;
@@ -69,7 +71,8 @@ class TestLogWriter : public LogWriter {
 
 TEST(StandardLogHandler, simple) {
   auto writer = make_shared<TestLogWriter>();
-  StandardLogHandler handler(make_shared<TestLogFormatter>(), writer);
+  LogHandlerConfig config{"std_test"};
+  StandardLogHandler handler(config, make_shared<TestLogFormatter>(), writer);
 
   LoggerDB db{LoggerDB::TESTING};
   auto logCategory = db.getCategory("log_cat");
@@ -89,7 +92,8 @@ TEST(StandardLogHandler, simple) {
 
 TEST(StandardLogHandler, levelCheck) {
   auto writer = make_shared<TestLogWriter>();
-  StandardLogHandler handler(make_shared<TestLogFormatter>(), writer);
+  LogHandlerConfig config{"std_test"};
+  StandardLogHandler handler(config, make_shared<TestLogFormatter>(), writer);
 
   LoggerDB db{LoggerDB::TESTING};
   auto logCategory = db.getCategory("log_cat");