| # Gaudi Framework, version v23r0 |

Home |  | Generated: Mon Jan 30 2012

Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends

# IssueSeverity Class Reference

`#include <IssueSeverity.h>`

Collaboration diagram for IssueSeverity:
[legend]

List of all members.

## Public Types
enum | Level { NIL = 0, VERBOSE, DEBUG, DEBUG1, DEBUG2, DEBUG3, INFO, WARNING, RECOVERABLE, ERROR, FATAL, ALWAYS, NUM_LEVELS }
## Public Member Functions
| IssueSeverity ()
| IssueSeverity (const IssueSeverity::Level &level, int line, const std::string &file, const std::string &msg="")
| IssueSeverity (const IssueSeverity::Level &level, const std::string &msg="")
| IssueSeverity (const IssueSeverity &es)
| IssueSeverity (IssueSeverity *es)
IssueSeverity & | operator= (const IssueSeverity &rhs)
| ~IssueSeverity ()
void | setLevel (const IssueSeverity::Level &l)
void | setMsg (const std::string &m)
IssueSeverity::Level | getLevel () const
std::string | getMsg () const
std::string | getOrigin () const
void | report ()
| operator StatusCode () const
## Static Private Member Functions
static void | init ()
## Private Attributes
int | m_line
std::string | m_file
IssueSeverity::Level | m_level
std::string | m_msg
bool | m_reported
## Static Private Attributes
static bool | m_init
static IIssueLogger * | m_ers
## Friends
std::ostream & | operator<< (std::ostream &, const IssueSeverity &)

## Detailed Description

Definition at line 42 of file IssueSeverity.h.

## Member Enumeration Documentation

enum IssueSeverity::Level

Enumerator:

  NIL |
  VERBOSE |
  DEBUG |
  DEBUG1 |
  DEBUG2 |
  DEBUG3 |
  INFO |
  WARNING |
  RECOVERABLE |
  ERROR |
  FATAL |
  ALWAYS |
  NUM_LEVELS |

Definition at line 46 of file IssueSeverity.h.

                 {
        NIL = 0,
        VERBOSE,
        DEBUG,
        DEBUG1,
        DEBUG2,
        DEBUG3,
        INFO,
        WARNING,
        RECOVERABLE,
        ERROR,
        FATAL,
        ALWAYS,
        NUM_LEVELS
      };

## Constructor & Destructor Documentation

IssueSeverity::IssueSeverity | ( | ) | `[inline]`

Definition at line 109 of file IssueSeverity.h.

                                       : m_line(0), m_file(""),
                                           m_level(IssueSeverity::NIL),
                                           m_msg(""), m_reported(true) {}

IssueSeverity::IssueSeverity | ( | const IssueSeverity::Level & | level,
|  | int | line,
|  | const std::string & | file,
|  | const std::string & | msg = `""`
| ) |  | `[inline]`

Definition at line 113 of file IssueSeverity.h.

                                                             :
      m_line(line), m_file(file), m_level(level), m_msg(msg), m_reported(false) {

      init();
      report();

    }

IssueSeverity::IssueSeverity | ( | const IssueSeverity::Level & | level,
|  | const std::string & | msg = `""`
| ) |  | `[inline]`

Definition at line 123 of file IssueSeverity.h.

                                                             :
      m_line(0), m_file("??"), m_level(level), m_msg(msg), m_reported(false) {

      init();
      report();

    }

IssueSeverity::IssueSeverity | ( | const IssueSeverity & | es ) | `[inline]`

Definition at line 132 of file IssueSeverity.h.

                                                                  {
      m_line = rhs.m_line;
      m_file = rhs.m_file;
      m_level = rhs.m_level;
      m_msg   = rhs.m_msg;
      m_reported = true;
    }

IssueSeverity::IssueSeverity | ( | IssueSeverity * | es ) | `[inline]`

Definition at line 140 of file IssueSeverity.h.

                                                            {
      m_line = rhs->m_line;
      m_file = rhs->m_file;
      m_level = rhs->m_level;
      m_msg   = rhs->m_msg;
      m_reported = true;
    }

IssueSeverity::~IssueSeverity | ( | ) |

Definition at line 22 of file IssueSeverity.cpp.

                                  {

      if (!m_reported) {
        report();
        // do stuff
      }

    }

## Member Function Documentation

IssueSeverity::Level IssueSeverity::getLevel | ( | ) | const`[inline]`

Definition at line 82 of file IssueSeverity.h.

    { return m_level; }

std::string IssueSeverity::getMsg | ( | ) | const`[inline]`

Definition at line 83 of file IssueSeverity.h.

    { return m_msg; }

std::string IssueSeverity::getOrigin | ( | ) | const

Definition at line 45 of file IssueSeverity.cpp.

                                   {
      std::ostringstream ost;
      ost << m_file << ":" << m_line;
      return ost.str();
    }

void IssueSeverity::init | ( | ) | `[static, private]`

Definition at line 15 of file IssueSeverity.cpp.

                             {
      if (!m_init) {
        m_init = true;
        m_ers = Gaudi::svcLocator()->service<IIssueLogger>("IssueLogger").get();
      }
    }

IssueSeverity::operator StatusCode | ( | ) | const

Definition at line 51 of file IssueSeverity.cpp.

                                             {
      if (m_level == IssueSeverity::RECOVERABLE) {
        return StatusCode(StatusCode::RECOVERABLE, *this);
      } else if (m_level < IssueSeverity::ERROR) {
        return StatusCode(StatusCode::SUCCESS, *this);
      } else {
        return StatusCode(StatusCode::FAILURE, *this);
      }
    }

IssueSeverity & IssueSeverity::operator= | ( | const IssueSeverity & | rhs ) | `[inline]`

Definition at line 148 of file IssueSeverity.h.

                                                                           {
      m_line = rhs.m_line;
      m_file = rhs.m_file;
      m_level = rhs.m_level;
      m_msg   = rhs.m_level;
      m_reported = true;
      return *this;
    }

void IssueSeverity::report | ( | ) |

Definition at line 32 of file IssueSeverity.cpp.

                          {

      if (m_ers != 0) {
        m_ers->report(this);
      } else {
        std::cerr << *this << std::endl;
      }
      m_reported = true;

    }

void IssueSeverity::setLevel | ( | const IssueSeverity::Level & | l ) | `[inline]`

Definition at line 75 of file IssueSeverity.h.

                                                 {
        m_level = l;
      }

void IssueSeverity::setMsg | ( | const std::string & | m ) | `[inline]`

Definition at line 78 of file IssueSeverity.h.

                                      {
        m_msg = m;
      }

## Friends And Related Function Documentation

std::ostream& operator<< | ( | std::ostream & | os,
|  | const IssueSeverity & | rhs
| ) |  | `[friend]`

Definition at line 157 of file IssueSeverity.h.

                                                                         {
      os << "ISSUE:  level " << rhs.getLevel() << " from: " << rhs.getOrigin()
         << " msg: " << rhs.getMsg();
      return os;
    }

## Member Data Documentation

IIssueLogger * IssueSeverity::m_ers`[static, private]`

Definition at line 99 of file IssueSeverity.h.

std::string IssueSeverity::m_file`[private]`

Definition at line 96 of file IssueSeverity.h.

bool IssueSeverity::m_init`[static, private]`

Definition at line 98 of file IssueSeverity.h.

IssueSeverity::Level IssueSeverity::m_level`[private]`

Definition at line 101 of file IssueSeverity.h.

int IssueSeverity::m_line`[private]`

Definition at line 95 of file IssueSeverity.h.

std::string IssueSeverity::m_msg`[private]`

Definition at line 102 of file IssueSeverity.h.

bool IssueSeverity::m_reported`[private]`

Definition at line 103 of file IssueSeverity.h.

The documentation for this class was generated from the following files:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiKernel/GaudiKernel/IssueSeverity.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiKernel/src/Lib/IssueSeverity.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines