aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/VppLogHandler.hpp
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-06-19 08:30:46 -0700
committerNeale Ranns <nranns@cisco.com>2019-06-26 16:41:01 +0000
commita83d9d67113dc75d21a68dba14891ed5e1bea7ec (patch)
tree829b8724c836bc48be1a45901291df129d678f69 /src/include/VppLogHandler.hpp
parentef426ed7714e87cee2097ed5245a78b92a0158ce (diff)
Initial Commit of VPP OPflex Renderer
Change-Id: I6264537538ad2646cddfa404de38a6bbf3abaa35 Signed-off-by: Neale Ranns <nranns@cisco.com>
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