voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
logger.hpp
1 #ifndef BLUB_LOG_LOGGER_HPP
2 #define BLUB_LOG_LOGGER_HPP
3 
4 #include "blub/core/globals.hpp"
5 
6 #include <boost/log/sources/severity_logger.hpp>
7 #include <boost/log/sources/record_ostream.hpp>
8 
9 #include <ostream>
10 
11 
12 namespace blub
13 {
14 namespace log
15 {
16  enum class severity
17  {
18  out,
19  warning,
20  error
21  };
22 
23  inline std::ostream& operator<< (std::ostream& strm, blub::log::severity severity_)
24  {
25  static const char* strings[] =
26  {
27  "out",
28  "warning",
29  "error",
30  };
31  std::size_t castedLevel(static_cast< std::size_t >(severity_));
32  if (castedLevel < sizeof(strings) / sizeof(*strings))
33  {
34  strm << strings[castedLevel];
35  }
36  else
37  {
38  strm << castedLevel;
39  }
40 
41  return strm;
42  }
43 
44  class logger : public boost::log::sources::severity_logger_mt<blub::log::severity>
45  {
46  public:
47  typedef boost::log::sources::severity_logger_mt<blub::log::severity> t_base;
48 
49  logger(const blub::string &moduleName);
50  ~logger() {;}
51  };
52 }
53 }
54 
55 
56 #endif // BLUB_LOG_LOGGER_HPP
Definition: string.hpp:22
Definition: logger.hpp:44
Definition: deadlineTimer.hpp:10