ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
VP1Trig::Logger Class Reference

#include <Logger.h>

Inheritance diagram for VP1Trig::Logger:
Collaboration diagram for VP1Trig::Logger:

Public Member Functions

 Logger (const std::string &name)
 
 Logger ()
 
virtual ~Logger ()
 
void log_info (const QString &msg)
 
void log_warning (const QString &msg)
 
void log_verbose (const QString &msg)
 
void log_error (const QString &msg)
 
void log_fatal (const QString &msg)
 
void log_debug (const QString &msg)
 
std::string prefix (std::string str)
 
QString qstr (char c)
 
QString qstr (std::string str)
 

Static Public Member Functions

static const QString pfx1 ()
 
static const QString pfx2 ()
 
static const QString pfx3 ()
 

Private Attributes

std::string m_name
 
int m_lvl
 

Detailed Description

Definition at line 32 of file graphics/VP1/VP1Systems/VP1TriggerSystems/VP1TriggerSystems/Logger.h.

Constructor & Destructor Documentation

◆ Logger() [1/2]

VP1Trig::Logger::Logger ( const std::string &  name)

◆ Logger() [2/2]

VP1Trig::Logger::Logger ( )

Definition at line 19 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

20  : m_name("VP1Trig::?"),m_lvl(0) {}

◆ ~Logger()

virtual VP1Trig::Logger::~Logger ( )
inlinevirtual

Member Function Documentation

◆ log_debug()

void VP1Trig::Logger::log_debug ( const QString &  msg)

Definition at line 54 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

54  {
55  std::cout<<prefix(m_name)<<"DEBUG "<<msg.toStdString()<<std::endl;
56 }

◆ log_error()

void VP1Trig::Logger::log_error ( const QString &  msg)

Definition at line 46 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

46  {
47  std::cout<<prefix(m_name)<<"ERROR "<<msg.toStdString()<<std::endl;
48 }

◆ log_fatal()

void VP1Trig::Logger::log_fatal ( const QString &  msg)

Definition at line 49 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

49  {
50  std::cout<<prefix(m_name)<<"FATAL "<<msg.toStdString()<<std::endl;
51 }

◆ log_info()

void VP1Trig::Logger::log_info ( const QString &  msg)

Definition at line 32 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

32  {
33  if(m_lvl>=1)
34  std::cout<<prefix(m_name)<<"INFO "<<msg.toStdString()<<std::endl;
35 }

◆ log_verbose()

void VP1Trig::Logger::log_verbose ( const QString &  msg)

Definition at line 40 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

40  {
41  if(m_lvl>=3)
42  std::cout<<prefix(m_name)<<"VERBOSE "<<msg.toStdString()<<std::endl;
43 }

◆ log_warning()

void VP1Trig::Logger::log_warning ( const QString &  msg)

Definition at line 36 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

36  {
37  if(m_lvl>=2)
38  std::cout<<prefix(m_name)<<"WARNING "<<msg.toStdString()<<std::endl;
39 }

◆ pfx1()

static const QString VP1Trig::Logger::pfx1 ( )
inlinestatic

◆ pfx2()

static const QString VP1Trig::Logger::pfx2 ( )
inlinestatic

◆ pfx3()

static const QString VP1Trig::Logger::pfx3 ( )
inlinestatic

◆ prefix()

std::string VP1Trig::Logger::prefix ( std::string  str)

Definition at line 61 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

62 {
63  //15 character prefix standard
64  if(int(str.size())>15) {
65  str=str.substr(0,15);
66  str=str+std::string("... ");
67  return str;
68  }
69  else if(int(str.size())==15) {
70  str=str+std::string(" ");
71  return str;
72  }
73  int q=21-int(str.size());
74  for(int i=0;i<q;++i)
75  str=str+std::string(" ");
76  return str;
77 }

◆ qstr() [1/2]

QString VP1Trig::Logger::qstr ( char  c)

Definition at line 82 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

83 {
84  std::stringstream ss; ss<<c;
85  std::string cStr=ss.str();
86  ss.str(std::string()); ss.clear();
87  return QString::fromStdString(cStr);
88 }

◆ qstr() [2/2]

QString VP1Trig::Logger::qstr ( std::string  str)

Definition at line 93 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

94 {
95  return QString::fromStdString(str);
96 }

Member Data Documentation

◆ m_lvl

int VP1Trig::Logger::m_lvl
private

◆ m_name

std::string VP1Trig::Logger::m_name
private

The documentation for this class was generated from the following files:
VP1Trig::Logger::m_name
std::string m_name
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/VP1TriggerSystems/Logger.h:70
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
VP1Trig::Logger::m_lvl
int m_lvl
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/VP1TriggerSystems/Logger.h:71
lumiFormat.i
int i
Definition: lumiFormat.py:92
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
VP1Trig::Logger::prefix
std::string prefix(std::string str)
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx:61
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
extractSporadic.q
list q
Definition: extractSporadic.py:98
str
Definition: BTagTrackIpAccessor.cxx:11
python.compressB64.c
def c
Definition: compressB64.py:93
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7