19 #ifndef LOGGINGPLUGIN_H
20 #define LOGGINGPLUGIN_H
22 #include <DobbyLoggerBase.h>
24 #include "IPollLoop.h"
26 #include "ILoggingSink.h"
28 #include <sys/types.h>
36 #define PTY_BUFFER_SIZE 4096
44 LoggingPlugin(std::shared_ptr<rt_dobby_schema> &containerConfig,
45 const std::shared_ptr<DobbyRdkPluginUtils> &utils,
46 const std::string &rootfsPath);
51 inline std::string
name()
const override
67 void DumpToLog(
const int bufferFd)
override;
71 enum class LoggingSink
79 std::shared_ptr<ILoggingSink>
CreateSink(LoggingSink sinkType);
83 const std::string mName;
84 std::shared_ptr<rt_dobby_schema> mContainerConfig;
85 const std::shared_ptr<DobbyRdkPluginUtils> mUtils;
87 std::shared_ptr<ILoggingSink> mSink;
88 std::shared_ptr<AICommon::IPollLoop> mPollLoop;
Definition: DobbyLoggerBase.h:34
Dobby Logging plugin.
Definition: LoggingPlugin.h:42
void RegisterPollSources(int fd, std::shared_ptr< AICommon::IPollLoop > pollLoop) override
Adds the necessary poll source(s) to the provided pollLoop instance based on the logging sink specifi...
Definition: LoggingPlugin.cpp:151
void DumpToLog(const int bufferFd) override
Dump the contents of a file descriptor to the log sink.
Definition: LoggingPlugin.cpp:189
LoggingSink GetContainerSink()
Converts the "sink: xxx" in the config to a valid log sink. Case insensitive.
Definition: LoggingPlugin.cpp:240
std::vector< std::string > getDependencies() const override
Should return the names of the plugins this plugin depends on.
Definition: LoggingPlugin.cpp:131
unsigned hookHints() const override
Set the bit flags for which hooks we're going to use.
Definition: LoggingPlugin.cpp:81
bool postInstallation() override
Set the correct options in the config file.
Definition: LoggingPlugin.cpp:91
LoggingPlugin(std::shared_ptr< rt_dobby_schema > &containerConfig, const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::string &rootfsPath)
Constructor - called when plugin is loaded by PluginLauncher.
Definition: LoggingPlugin.cpp:48
std::string name() const override
Should return the name of the plugin.
Definition: LoggingPlugin.h:51
std::shared_ptr< ILoggingSink > CreateSink(LoggingSink sinkType)
Constructs an instance of the requested sink.
Definition: LoggingPlugin.cpp:215