proxygen
folly::TestHandlerFactory Class Reference
Inheritance diagram for folly::TestHandlerFactory:
folly::LogHandlerFactory

Classes

class  TestWriterFactory
 

Public Member Functions

 TestHandlerFactory (const std::shared_ptr< TestLogWriter > writer)
 
StringPiece getType () const override
 
std::shared_ptr< LogHandlercreateHandler (const Options &options) override
 
- Public Member Functions inherited from folly::LogHandlerFactory
virtual ~LogHandlerFactory ()=default
 
virtual std::shared_ptr< LogHandlerupdateHandler (FOLLY_MAYBE_UNUSED const std::shared_ptr< LogHandler > &existingHandler, const Options &options)
 

Private Attributes

std::shared_ptr< TestLogWriterwriter_
 

Additional Inherited Members

- Public Types inherited from folly::LogHandlerFactory
using Options = std::unordered_map< std::string, std::string >
 

Detailed Description

Definition at line 51 of file SyncLevelTest.cpp.

Constructor & Destructor Documentation

folly::TestHandlerFactory::TestHandlerFactory ( const std::shared_ptr< TestLogWriter writer)
inline

Definition at line 53 of file SyncLevelTest.cpp.

54  : writer_(writer) {}
std::shared_ptr< TestLogWriter > writer_

Member Function Documentation

std::shared_ptr<LogHandler> folly::TestHandlerFactory::createHandler ( const Options options)
inlineoverridevirtual

Create a new LogHandler.

Implements folly::LogHandlerFactory.

Definition at line 60 of file SyncLevelTest.cpp.

References folly::StandardLogHandlerFactory::createHandler().

60  {
61  TestWriterFactory writerFactory{writer_};
63  getType(), &writerFactory, options);
64  }
static std::shared_ptr< StandardLogHandler > createHandler(StringPiece type, WriterFactory *writerFactory, const Options &options)
StringPiece getType() const override
std::shared_ptr< TestLogWriter > writer_
StringPiece folly::TestHandlerFactory::getType ( ) const
inlineoverridevirtual

Get the type name of this LogHandlerFactory.

The type field in the LogHandlerConfig for all LogHandlers created by this factory should match the type of the LogHandlerFactory.

The type of a LogHandlerFactory should never change. The returned StringPiece should be valid for the lifetime of the LogHandlerFactory.

Implements folly::LogHandlerFactory.

Definition at line 56 of file SyncLevelTest.cpp.

56  {
57  return "test";
58  }

Member Data Documentation

std::shared_ptr<TestLogWriter> folly::TestHandlerFactory::writer_
private

Definition at line 67 of file SyncLevelTest.cpp.


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