aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-04-21 19:15:31 -0700
committerMartin Braun <martin.braun@ettus.com>2017-04-22 19:23:07 -0700
commitc4da30c0ce4d37d0f2bd9dd2883e45ed0919cd2c (patch)
tree2c1e35b4c978eb6046bbfa9b6f864e84eb8e0db1 /host/include
parent1b690d7ab41345973592800612720020bb262859 (diff)
downloaduhd-c4da30c0ce4d37d0f2bd9dd2883e45ed0919cd2c.tar.gz
uhd-c4da30c0ce4d37d0f2bd9dd2883e45ed0919cd2c.tar.bz2
uhd-c4da30c0ce4d37d0f2bd9dd2883e45ed0919cd2c.zip
log: Fixed various issues
- Made the task a regular thread - Moved verbosity operator into lib - Minor comments and indents and so on
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/utils/log.hpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/host/include/uhd/utils/log.hpp b/host/include/uhd/utils/log.hpp
index a7814342c..a27a536b1 100644
--- a/host/include/uhd/utils/log.hpp
+++ b/host/include/uhd/utils/log.hpp
@@ -111,7 +111,7 @@ namespace uhd {
* Either numeric value or string can be used to define loglevel in
* CMake and environment variables
*/
- enum UHD_API severity_level {
+ enum severity_level {
trace = 0, /**< displays every available log message */
debug = 1, /**< displays most log messages necessary for debugging internals */
info = 2, /**< informational messages about setup and what is going on*/
@@ -127,7 +127,8 @@ namespace uhd {
* logging_info structure.
*/
struct UHD_API logging_info {
- logging_info(){};
+ logging_info()
+ : verbosity(uhd::log::off) {}
logging_info(
const boost::posix_time::ptime &time_,
const uhd::log::severity_level &verbosity_,
@@ -194,25 +195,6 @@ namespace uhd {
* \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);
-
- // The operator is used when putting the severity level to log
- template <typename CharT, typename TraitsT>
- inline std::basic_ostream<CharT, TraitsT>&
- operator<<(std::basic_ostream<CharT, TraitsT>& strm, severity_level level)
- {
- static const char* strings[] = {"TRACE", "DEBUG", "INFO",
- "WARNING", "ERROR", "FATAL"
- };
-
- if (static_cast<std::size_t>(level) < sizeof(strings) / sizeof(*strings)) {
- strm << strings[level];
- } else {
- strm << static_cast<int>(level);
- }
-
- return strm;
- }
-
}
}