osquery-1/osquery/logger/plugin.h
2014-08-05 16:13:55 -07:00

36 lines
744 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 */