All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
log.hpp
Go to the documentation of this file.
//
// Copyright 2011 Ettus Research LLC
//
// 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/>.
//
#ifndef INCLUDED_UHD_UTILS_LOG_HPP
#define INCLUDED_UHD_UTILS_LOG_HPP
#include <uhd/config.hpp>
#include <uhd/utils/pimpl.hpp>
#include <boost/current_function.hpp>
#include <ostream>
#include <string>
#define UHD_LOGV(verbosity) \
uhd::_log::log(uhd::_log::verbosity, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)()
#define UHD_LOG \
UHD_LOGV(regularly)
namespace uhd{ namespace _log{
enum verbosity_t{
always = 1,
often = 2,
regularly = 3,
rarely = 4,
very_rarely = 5,
never = 6,
};
class UHD_API log{
public:
log(
const verbosity_t verbosity,
const std::string &file,
const unsigned int line,
const std::string &function
);
~log(void);
std::ostream &operator()(void);
private:
UHD_PIMPL_DECL(impl) _impl;
};
}} //namespace uhd::_log
#endif /* INCLUDED_UHD_UTILS_LOG_HPP */