proxygen
|
#include <FileHandlerFactory.h>
Classes | |
class | WriterFactory |
Public Member Functions | |
StringPiece | getType () const override |
std::shared_ptr< LogHandler > | createHandler (const Options &options) override |
Public Member Functions inherited from folly::LogHandlerFactory | |
virtual | ~LogHandlerFactory ()=default |
virtual std::shared_ptr< LogHandler > | updateHandler (FOLLY_MAYBE_UNUSED const std::shared_ptr< LogHandler > &existingHandler, const Options &options) |
Additional Inherited Members | |
Public Types inherited from folly::LogHandlerFactory | |
using | Options = std::unordered_map< std::string, std::string > |
FileHandlerFactory is a LogHandlerFactory that constructs log handlers that write to a file.
Note that FileHandlerFactory allows opening and appending to arbitrary files based on the handler options. This may make it unsafe to use FileHandlerFactory in some contexts: for instance, a setuid binary should generally avoid registering the FileHandlerFactory if they allow log handlers to be configured via command line parameters, since otherwise this may allow non-root users to append to files that they otherwise would not have write permissions for.
Definition at line 34 of file FileHandlerFactory.h.
|
overridevirtual |
Create a new LogHandler.
Implements folly::LogHandlerFactory.
Definition at line 52 of file FileHandlerFactory.cpp.
References folly::StandardLogHandlerFactory::createHandler(), and getType().
Referenced by getType(), and TEST().
|
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 36 of file FileHandlerFactory.h.
References createHandler().
Referenced by createHandler().