osquery-1/osquery/logger/plugin.h
2014-08-15 12:29:51 -07:00

37 lines
774 B
C++

// Copyright 2004-present Facebook. All Rights Reserved.
#ifndef OSQUERY_LOGGER_PLUGIN_H
#define OSQUERY_LOGGER_PLUGIN_H
#include <memory>
#include "osquery/registry.h"
#include "osquery/status.h"
namespace osquery {
namespace logger {
class LoggerPlugin {
public:
virtual osquery::Status logString(const std::string& s) {
return osquery::Status(1, "Not implemented");
}
virtual ~LoggerPlugin() {}
protected:
LoggerPlugin() {};
};
}
}
DECLARE_REGISTRY(LoggerPlugins,
std::string,
std::shared_ptr<osquery::logger::LoggerPlugin>)
#define REGISTERED_LOGGER_PLUGINS REGISTRY(LoggerPlugins)
#define REGISTER_LOGGER_PLUGIN(name, decorator) \
REGISTER(LoggerPlugins, name, decorator)
#endif /* OSQUERY_LOGGER_PLUGIN_H */