voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
global.hpp
1 #ifndef BLUB_LOG_GLOBAL_HPP
2 #define BLUB_LOG_GLOBAL_HPP
3 
4 #include "blub/core/string.hpp"
5 #include "blub/log/globalLogger.hpp"
6 #include "blub/log/logger.hpp"
7 #include "blub/log/predecl.hpp"
8 
9 #include <boost/log/utility/manipulators/add_value.hpp>
10 
11 
12 namespace blub
13 {
14 namespace log
15 {
16 BLUB_LOG_GLOBAL_LOGGER(global, logger)
17 }
18 }
19 
20 
21 // TODO custom log source would be more beautiful http://www.boost.org/doc/libs/1_57_0/libs/log/doc/html/log/extension/sources.html
22 #ifdef BLUB_LOG_LOCATION
23 # define BLUB_LOG_SEV(destination, severity) BOOST_LOG_SEV(destination, severity) << boost::log::add_value<blub::string>("Location", __PRETTY_FUNCTION__)
24 # define BLUB_LOG_SEV_WITHOUT_LOCATION(destination, severity) BOOST_LOG_SEV(destination, severity) << boost::log::add_value<blub::string>("Location", __PRETTY_FUNCTION__)
25 #else
26 # define BLUB_LOG_SEV(destination, severity) BOOST_LOG_SEV(destination, severity)
27 # define BLUB_LOG_SEV_WITHOUT_LOCATION(destination, severity) BOOST_LOG_SEV(destination, severity)
28 #endif
29 
30 #define BLUB_LOG_OUT_TO(destination) BLUB_LOG_SEV(destination, blub::log::severity::out)
31 #define BLUB_LOG_OUT() BLUB_LOG_OUT_TO(blub::log::global::get())
32 
33 #define BLUB_LOG_WARNING_TO(destination) BLUB_LOG_SEV(destination, blub::log::severity::warning)
34 #define BLUB_LOG_WARNING() BLUB_LOG_WARNING_TO(blub::log::global::get())
35 
36 #define BLUB_LOG_ERROR_TO(destination) BLUB_LOG_SEV(destination, blub::log::severity::error)
37 #define BLUB_LOG_ERROR() BLUB_LOG_ERROR_TO(blub::log::global::get())
38 
39 
40 #endif // BLUB_LOG_GLOBAL_HPP
Definition: deadlineTimer.hpp:10