UHD  003.001.000
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
log.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2011 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_UHD_UTILS_LOG_HPP
19 #define INCLUDED_UHD_UTILS_LOG_HPP
20 
21 #include <uhd/config.hpp>
22 #include <boost/current_function.hpp>
23 #include <ostream>
24 #include <string>
25 
56 #define UHD_LOGV(verbosity) \
57  uhd::_log::log(uhd::_log::verbosity, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)()
58 
63 #define UHD_LOG \
64  UHD_LOGV(regularly)
65 
66 
67 namespace uhd{ namespace _log{
68 
71  always = 1,
72  often = 2,
73  regularly = 3,
74  rarely = 4,
76  never = 6,
77  };
78 
81  log(
82  const verbosity_t verbosity,
83  const std::string &file,
84  const unsigned int line,
85  const std::string &function
86  );
87  ~log(void);
88  std::ostream &operator()(void);
89  };
90 
91 }} //namespace uhd::_log
92 
93 #endif /* INCLUDED_UHD_UTILS_LOG_HPP */
Definition: log.hpp:71
Definition: log.hpp:73
Definition: log.hpp:76
Internal logging object (called by UHD_LOG macros)
Definition: log.hpp:80
Definition: convert.hpp:28
verbosity_t
Verbosity levels for the logger.
Definition: log.hpp:70
Definition: log.hpp:74
#define UHD_API_FUTURE
Definition: config.hpp:83
Definition: log.hpp:72
Definition: log.hpp:75