ATLAS Offline Software
Loading...
Searching...
No Matches
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

Constructor & Destructor Documentation

◆ Logger() [1/2]

◆ 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}
MsgStream & msg
Definition testRead.cxx:32

◆ 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()

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

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

51{return " ";}

◆ pfx2()

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

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

52{return " ";}

◆ pfx3()

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

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

53{return " ";}

◆ 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.resize(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}
static Double_t ss

◆ 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: