LArOpenCV  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
larcaffe_logger.cxx
Go to the documentation of this file.
1 #ifndef __LARCAFFELOGGER_CXX__
2 #define __LARCAFFELOGGER_CXX__
3 
4 #include "larcaffe_logger.h"
5 namespace larcaffe {
6 
7  std::map<std::string,logger> *logger::_logger_m = nullptr;
8 
9  std::ostream& logger::send(const msg::Level_t level) const
10  {
11  (*_ostrm) << msg::kStringPrefix[level].c_str()
12  << "\033[0m ";
13  return (*_ostrm);
14  }
15 
16  std::ostream& logger::send(const msg::Level_t level,
17  const std::string& function ) const
18  {
19  auto& strm(send(level));
20  strm << "\033[94m<" << _name << "::" << function.c_str() << ">\033[00m ";
21  return strm;
22  }
23 
24  std::ostream& logger::send(const msg::Level_t level,
25  const std::string& function,
26  const unsigned int line_num ) const
27  {
28  auto& strm(send(level));
29  strm << "\033[94m<" << _name << "::" << function.c_str() << "::L" << line_num << ">\033[00m ";
30  return strm;
31  }
32 
33  std::ostream& logger::send(const msg::Level_t level,
34  const std::string& function,
35  const unsigned int line_num,
36  const std::string& file_name) const
37  {
38  auto& strm(send(level,function));
39  strm << file_name.c_str() << "::L" << line_num << " ";
40  return strm;
41  }
42 }
43 #endif