aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/utils/log.hpp14
-rw-r--r--host/include/uhd/utils/log_add.hpp46
-rw-r--r--host/lib/utils/log.cpp1
-rw-r--r--host/tests/log_test.cpp1
4 files changed, 48 insertions, 14 deletions
diff --git a/host/include/uhd/utils/log.hpp b/host/include/uhd/utils/log.hpp
index 24c7bc1c6..58b3afed4 100644
--- a/host/include/uhd/utils/log.hpp
+++ b/host/include/uhd/utils/log.hpp
@@ -153,13 +153,6 @@ namespace uhd {
std::string message;
};
- /*! Logging function type
- *
- * Every logging_backend has to define a function with this signature.
- * Can be added to the logging core.
- */
- typedef std::function<void(const uhd::log::logging_info&)> log_fn_t ;
-
/*! Set the global log level
*
* The global log level gets applied before the specific log level.
@@ -188,13 +181,6 @@ namespace uhd {
* \throws uhd::key_error if \p logger was not defined
*/
UHD_API void set_logger_level(const std::string &logger, uhd::log::severity_level level);
-
- /*! Add logging backend to the log system
- *
- * \param key Identifies the logging backend in the logging core
- * \param logger_fn function which actually logs messages to this backend
- */
- UHD_API void add_logger(const std::string &key, log_fn_t logger_fn);
}
}
diff --git a/host/include/uhd/utils/log_add.hpp b/host/include/uhd/utils/log_add.hpp
new file mode 100644
index 000000000..99b2e6dfc
--- /dev/null
+++ b/host/include/uhd/utils/log_add.hpp
@@ -0,0 +1,46 @@
+//
+// Copyright 2017 Ettus Research (National Instruments Corp.)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+// Note: Including this file requires C++11 features enabled.
+
+#ifndef INCLUDED_UHD_UTILS_LOG_ADD_HPP
+#define INCLUDED_UHD_UTILS_LOG_ADD_HPP
+
+#include <uhd/config.hpp>
+#include <uhd/utils/log.hpp>
+#include <functional>
+
+namespace uhd {
+ namespace log {
+
+ /*! Logging function type
+ *
+ * Every logging_backend has to define a function with this signature.
+ * Can be added to the logging core.
+ */
+ typedef std::function<void(const uhd::log::logging_info&)> log_fn_t ;
+
+ /*! Add logging backend to the log system
+ *
+ * \param key Identifies the logging backend in the logging core
+ * \param logger_fn function which actually logs messages to this backend
+ */
+ UHD_API void add_logger(const std::string &key, log_fn_t logger_fn);
+ }
+} /* namespace uhd::log */
+
+#endif /* INCLUDED_UHD_UTILS_LOG_ADD_HPP */
diff --git a/host/lib/utils/log.cpp b/host/lib/utils/log.cpp
index bfa012323..e850d1374 100644
--- a/host/lib/utils/log.cpp
+++ b/host/lib/utils/log.cpp
@@ -16,6 +16,7 @@
//
#include <uhd/utils/log.hpp>
+#include <uhd/utils/log_add.hpp>
#include <uhd/utils/static.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/transport/bounded_buffer.hpp>
diff --git a/host/tests/log_test.cpp b/host/tests/log_test.cpp
index c466777fc..b0b17ea84 100644
--- a/host/tests/log_test.cpp
+++ b/host/tests/log_test.cpp
@@ -17,6 +17,7 @@
#include <boost/test/unit_test.hpp>
#include <uhd/utils/log.hpp>
+#include <uhd/utils/log_add.hpp>
#include <iostream>
BOOST_AUTO_TEST_CASE(test_messages){