Enable glog plugin
authorsangwan.kwon <sangwan.kwon@samsung.com>
Tue, 21 May 2019 04:20:47 +0000 (13:20 +0900)
committerSangwan Kwon <sangwan.kwon@samsung.com>
Wed, 12 Jun 2019 00:04:42 +0000 (09:04 +0900)
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
osquery/config/CMakeLists.txt
osquery/config/plugins/glog.cpp [new file with mode: 0644]

index feb07b2dc57ff488bd1969b77ead58b5a4c86cd6..14419ea2f23328260cd0e7f10684165dca5993ae 100644 (file)
@@ -1,5 +1,5 @@
 ADD_OSQUERY_LIBRARY(osquery_config config.cpp
-                                                                  plugins/filesystem.cpp)
-                                                                  plugins/glog.cpp)
+                                                                  plugins/filesystem.cpp
+                                                                  plugins/glog.cpp)
 
 ADD_OSQUERY_TEST(osquery_config_tests config_tests.cpp)
diff --git a/osquery/config/plugins/glog.cpp b/osquery/config/plugins/glog.cpp
new file mode 100644 (file)
index 0000000..2468d28
--- /dev/null
@@ -0,0 +1,18 @@
+#include "osquery/logger/plugin.h"
+
+#include <glog/logging.h>
+
+namespace osquery {
+
+class GlogPlugin : public LoggerPlugin {
+ public:
+  Status logString(const std::string& message) {
+    LOG(INFO) << message;
+    return Status(0, "OK");
+  }
+
+  virtual ~GlogPlugin() {}
+};
+
+REGISTER_LOGGER_PLUGIN("glog", std::make_shared<osquery::GlogPlugin>());
+}