Public Member Functions | Private Attributes | List of all members
mf::MaybeLogger_< SEV, VERBATIM > Class Template Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/messagefacility/v2_02_06/source/messagefacility/MessageLogger/MessageLogger.h"

Public Member Functions

 MaybeLogger_ (MaybeLogger_ const &)=delete
 
MaybeLogger_operator= (MaybeLogger_ const &)=delete
 
MaybeLogger_operator= (MaybeLogger_ &&)=delete
 
 ~MaybeLogger_ ()
 
 MaybeLogger_ ()
 
 MaybeLogger_ (MaybeLogger_ &&rhs) noexcept
 
 MaybeLogger_ (std::string const &category, std::string const &file="", int line_number=0)
 
decltype(auto) operator<< (char const *s)
 
template<class T >
decltype(auto) operator<< (T const &t)
 
decltype(auto) operator<< (std::ostream &(*f)(std::ostream &))
 
decltype(auto) operator<< (std::ios_base &(*f)(std::ios_base &))
 

Private Attributes

std::unique_ptr< ErrorObjmsg_ {}
 

Detailed Description

template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
class mf::MaybeLogger_< SEV, VERBATIM >

Definition at line 115 of file MessageLogger.h.

Constructor & Destructor Documentation

template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
mf::MaybeLogger_< SEV, VERBATIM >::MaybeLogger_ ( MaybeLogger_< SEV, VERBATIM > const &  )
delete
template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
mf::MaybeLogger_< SEV, VERBATIM >::~MaybeLogger_ ( )
inline

Definition at line 122 of file MessageLogger.h.

References mf::GetIteration(), mf::GetModuleName(), and mf::LogErrorObj().

123  {
124  if (msg_ == nullptr) {
125  return;
126  }
127  try {
128  msg_->setModule(GetModuleName());
129  msg_->setIteration(GetIteration());
130  LogErrorObj(msg_.release());
131  }
132  catch (...) {
133  // FIXME: We should never ignore errors!
134  }
135  }
std::string const & GetModuleName()
std::string const & GetIteration()
std::unique_ptr< ErrorObj > msg_
void LogErrorObj(ErrorObj *)
template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
mf::MaybeLogger_< SEV, VERBATIM >::MaybeLogger_ ( )
inline

Definition at line 137 of file MessageLogger.h.

137 : msg_{} {}
std::unique_ptr< ErrorObj > msg_
template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
mf::MaybeLogger_< SEV, VERBATIM >::MaybeLogger_ ( MaybeLogger_< SEV, VERBATIM > &&  rhs)
inlinenoexcept

Definition at line 139 of file MessageLogger.h.

139 : msg_{std::move(rhs.msg_)} {}
std::unique_ptr< ErrorObj > msg_
template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
mf::MaybeLogger_< SEV, VERBATIM >::MaybeLogger_ ( std::string const &  category,
std::string const &  file = "",
int  line_number = 0 
)
inline

Definition at line 141 of file MessageLogger.h.

References gen_flatrecord::category, file, and shutoffs::filename.

144  : msg_{}
145  {
146  // Verbatim messages have the full file path, otherwise just the basename.
148  if (!VERBATIM) {
149  auto const lastSlash = file.find_last_of('/');
150  if ((lastSlash != std::string::npos) &&
151  (lastSlash != (file.size() - 1))) {
152  filename = file.substr(lastSlash + 1, file.size() - lastSlash - 1);
153  }
154  }
155  msg_ = std::move(std::make_unique<ErrorObj>(
156  SEV, category, VERBATIM, filename, line_number));
157  }
string filename
Definition: shutoffs.py:106
std::unique_ptr< ErrorObj > msg_
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
TFile * file
Definition: cellShifts.C:17

Member Function Documentation

template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
decltype(auto) mf::MaybeLogger_< SEV, VERBATIM >::operator<< ( char const *  s)
inline

Definition at line 163 of file MessageLogger.h.

164  {
165  if (msg_) {
166  (*msg_) << s;
167  }
168  return std::forward<MaybeLogger_>(*this);
169  }
std::unique_ptr< ErrorObj > msg_
const XML_Char * s
Definition: expat.h:262
template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
template<class T >
decltype(auto) mf::MaybeLogger_< SEV, VERBATIM >::operator<< ( T const &  t)
inline

Definition at line 173 of file MessageLogger.h.

References confusionMatrixTree::t.

174  {
175  if (msg_) {
176  (*msg_) << t;
177  }
178  return std::forward<MaybeLogger_>(*this);
179  }
std::unique_ptr< ErrorObj > msg_
template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
decltype(auto) mf::MaybeLogger_< SEV, VERBATIM >::operator<< ( std::ostream &(*)(std::ostream &)  f)
inline

Definition at line 182 of file MessageLogger.h.

References MakeMiniprodValidationCuts::f.

183  {
184  if (msg_) {
185  (*msg_) << f;
186  }
187  return std::forward<MaybeLogger_>(*this);
188  }
std::unique_ptr< ErrorObj > msg_
template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
decltype(auto) mf::MaybeLogger_< SEV, VERBATIM >::operator<< ( std::ios_base &(*)(std::ios_base &)  f)
inline

Definition at line 191 of file MessageLogger.h.

References MakeMiniprodValidationCuts::f.

192  {
193  if (msg_) {
194  (*msg_) << f;
195  }
196  return std::forward<MaybeLogger_>(*this);
197  }
std::unique_ptr< ErrorObj > msg_
template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
MaybeLogger_& mf::MaybeLogger_< SEV, VERBATIM >::operator= ( MaybeLogger_< SEV, VERBATIM > const &  )
delete
template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
MaybeLogger_& mf::MaybeLogger_< SEV, VERBATIM >::operator= ( MaybeLogger_< SEV, VERBATIM > &&  )
delete

Member Data Documentation

template<ELseverityLevel::ELsev_ SEV, bool VERBATIM>
std::unique_ptr<ErrorObj> mf::MaybeLogger_< SEV, VERBATIM >::msg_ {}
private

Definition at line 200 of file MessageLogger.h.


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