All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OpT0FinderLogger.cxx
Go to the documentation of this file.
1 #ifndef __OPT0FINDERLOGGER_CXX__
2 #define __OPT0FINDERLOGGER_CXX__
3 
4 #include "OpT0FinderLogger.h"
5 namespace flashmatch {
6 
7  std::map<std::string,logger> *logger::_logger_m = nullptr;
8 
10 
11  std::ostream& logger::send(const msg::Level_t level) const
12  {
13  (*_ostrm) << msg::kStringPrefix[level].c_str()
14  << "\033[0m ";
15  return (*_ostrm);
16  }
17 
18  std::ostream& logger::send(const msg::Level_t level,
19  const std::string& function ) const
20  {
21  auto& strm(send(level));
22  strm << "\033[94m<" << _name << "::" << function.c_str() << ">\033[00m ";
23  return strm;
24  }
25 
26  std::ostream& logger::send(const msg::Level_t level,
27  const std::string& function,
28  const unsigned int line_num ) const
29  {
30  auto& strm(send(level));
31  strm << "\033[94m<" << _name << "::" << function.c_str() << "::L" << line_num << ">\033[00m ";
32  return strm;
33  }
34 
35  std::ostream& logger::send(const msg::Level_t level,
36  const std::string& function,
37  const unsigned int line_num,
38  const std::string& file_name) const
39  {
40  auto& strm(send(level,function));
41  // FIXME temporary operation to fetch file name from full path
42  strm << file_name.substr(file_name.rfind("/")+1,file_name.size()).c_str() << "::L" << line_num << " ";
43  return strm;
44  }
45 }
46 #endif
std::string _name
Name.
msg::Level_t level() const
Verbosity level getter.
std::ostream * _ostrm
ostream
std::ostream & send(const msg::Level_t) const
Formatted message (simplest)
const std::string kStringPrefix[kMSG_TYPE_MAX]
Prefix of message.
then echo fcl sbnd_project sbnd_project sbnd_project sbnd_project production production file_name
static std::map< std::string, flashmatch::logger > * _logger_m
Set of loggers.
Level_t
Verbosity message level.
logger utility class definition header file.
static msg::Level_t _level_default
Default logger level.