proxygen
LoggerTest Class Reference
Inheritance diagram for LoggerTest:
testing::Test

Protected Member Functions

void SetUp () override
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 

Static Protected Member Functions

static StringPiece pathBasename (StringPiece path)
 

Protected Attributes

LoggerDB db_ {LoggerDB::TESTING}
 
Logger logger_ {&db_, "test"}
 
std::shared_ptr< TestLogHandlerhandler_
 

Additional Inherited Members

- Public Types inherited from testing::Test
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
virtual ~Test ()
 
virtual ~Test ()
 
- Static Public Member Functions inherited from testing::Test
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 

Detailed Description

Definition at line 30 of file LoggerTest.cpp.

Member Function Documentation

static StringPiece LoggerTest::pathBasename ( StringPiece  path)
inlinestaticprotected

Definition at line 40 of file LoggerTest.cpp.

References folly::Range< const char * >::npos, folly::Range< Iter >::rfind(), folly::Range< Iter >::str(), and folly::Range< Iter >::subpiece().

40  {
41  auto idx = path.rfind('/');
42  if (idx == StringPiece::npos) {
43  return path.str();
44  }
45  return path.subpiece(idx + 1);
46  }
std::string str() const
Definition: Range.h:591
size_type rfind(value_type c) const
Definition: Range.h:761
Range subpiece(size_type first, size_type length=npos) const
Definition: Range.h:686
void LoggerTest::SetUp ( )
inlineoverrideprotectedvirtual

Reimplemented from testing::Test.

Definition at line 32 of file LoggerTest.cpp.

References folly::DBG.

32  {
33  auto* category = logger_.getCategory();
34 
35  handler_ = make_shared<TestLogHandler>();
36  category->addHandler(handler_);
37  category->setLevel(LogLevel::DBG, true);
38  }
Logger logger_
Definition: LoggerTest.cpp:49
LogCategory * getCategory() const
Definition: Logger.h:183
std::shared_ptr< TestLogHandler > handler_
Definition: LoggerTest.cpp:50

Member Data Documentation

LoggerDB LoggerTest::db_ {LoggerDB::TESTING}
protected

Definition at line 48 of file LoggerTest.cpp.

std::shared_ptr<TestLogHandler> LoggerTest::handler_
protected

Definition at line 50 of file LoggerTest.cpp.

Logger LoggerTest::logger_ {&db_, "test"}
protected

Definition at line 49 of file LoggerTest.cpp.


The documentation for this class was generated from the following file: