Logo ROOT  
Reference Guide
MnPrintImpl.cxx
Go to the documentation of this file.
1 #include "Minuit2/MnPrint.h"
2 
4 
5 #ifndef USE_ROOT_ERROR
6 
7 #include <iostream>
8 
9 #ifndef MN_OS
10 #define MN_OS std::cerr
11 #endif
12 
13 void MnPrint::Impl(MnPrint::Verbosity level, const std::string &s)
14 {
15  const char *label[4] = {"[Error]", "[Warn]", "[Info]", "[Debug]"};
16  const int ilevel = static_cast<int>(level);
17  MN_OS << label[ilevel] << " " << s << std::endl;
18 }
19 
20 #else // use ROOT error reporting system
21 
22 #include "TError.h"
23 #include <sstream>
24 
25 void MnPrint::Impl(MnPrint::Verbosity level, const std::string &s)
26 {
27  switch (level) {
28  case MnPrint::eError: ::Error("Minuit2", "%s", s.c_str()); break;
29  case MnPrint::eWarn: ::Warning("Minuit2", "%s", s.c_str()); break;
30  case MnPrint::eInfo:
31  case MnPrint::eDebug: ::Info("Minuit2", "%s", s.c_str()); break;
32  }
33 }
34 
35 #endif // USE_ROOT_ERROR
Warning
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition: TError.cxx:231
ROOT::Minuit2::MnPrint::eError
static constexpr auto eError
Definition: MnPrint.h:79
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
ROOT::Minuit2::MnPrint::eDebug
static constexpr auto eDebug
Definition: MnPrint.h:82
ROOT::Minuit2::MnPrint::Error
void Error(const Ts &... args)
Definition: MnPrint.h:120
ROOT::Minuit2::MnPrint::eWarn
static constexpr auto eWarn
Definition: MnPrint.h:80
ROOT::Minuit2::MnPrint::Verbosity
Verbosity
Definition: MnPrint.h:76
ROOT::Minuit2::MnPrint::Impl
static void Impl(Verbosity level, const std::string &s)
Definition: MnPrintImpl.cxx:13
MN_OS
#define MN_OS
Definition: MnPrintImpl.cxx:10
MnPrint.h
ROOT::Minuit2::MnPrint::eInfo
static constexpr auto eInfo
Definition: MnPrint.h:81
ROOT::Minuit2::MnPrint::Info
void Info(const Ts &... args)
Definition: MnPrint.h:132
ROOT::Minuit2::MnPrint
Definition: MnPrint.h:73
TError.h