aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/VppLogHandler.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/VppLogHandler.hpp')
-rw-r--r--src/include/VppLogHandler.hpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/include/VppLogHandler.hpp b/src/include/VppLogHandler.hpp
new file mode 100644
index 0000000..eca4a94
--- /dev/null
+++ b/src/include/VppLogHandler.hpp
@@ -0,0 +1,56 @@
+/* -*- C++ -*-; c-basic-offset: 4; indent-tabs-mode: nil */
+/*!
+ * @file VppLogHandler.h
+ * @brief Interface definition file for AgentLogHandler
+ */
+/*
+ * Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+#ifndef __VPP_LOG_HANDLER_H__
+#define __VPP_LOG_HANDLER_H__
+
+#include <vom/logger.hpp>
+
+namespace VPP
+{
+
+/**
+ * A VOM log handler that logs to the agnet logging mechanism
+ */
+class LogHandler : public VOM::log_t::handler
+{
+ public:
+ /**
+ * Constructor
+ */
+ LogHandler() = default;
+
+ /**
+ * Desctructor
+ */
+ ~LogHandler() = default;
+
+ /**
+ * Implement log_t::handler::handle_message
+ */
+ void handle_message(const std::string &file,
+ const int line,
+ const std::string &function,
+ const VOM::log_level_t &level,
+ const std::string &message);
+
+ private:
+ /**
+ * Copy Constructor
+ */
+ LogHandler(const LogHandler &) = delete;
+};
+
+} /* namespace opflexagent */
+
+#endif