Skip to content

Commit

Permalink
Merge pull request #17718 from dmitrijus/hcal_log_fix
Browse files Browse the repository at this point in the history
Make MonitorElement to emit LogWarning instead of writing to std::cout
  • Loading branch information
cmsbuild committed Mar 7, 2017
2 parents 34b3241 + 17734ac commit a14b3f8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions DQMServices/Core/src/MonitorElement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#include <cfloat>
#include <inttypes.h>

#if !WITHOUT_CMS_FRAMEWORK
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#endif

static TH1 *
checkRootObject(const std::string &name, TObject *tobj, const char *func, int reqdim)
{
Expand Down Expand Up @@ -927,9 +931,13 @@ MonitorElement::setBinLabel(int bin, const std::string &label, int axis /* = 1 *
}
else
{
// edm::LogWarning ("MonitorElement")
std::cout << "*** MonitorElement: WARNING:"
<<"setBinLabel: attempting to set label of non-existent bin number for ME: "<< getFullname() << " \n";
#if WITHOUT_CMS_FRAMEWORK
std::cout
#else
edm::LogWarning("MonitorElement")
#endif
<< "*** MonitorElement: WARNING:"
<<"setBinLabel: attempting to set label of non-existent bin number for ME: "<< getFullname() << " \n";
}
}

Expand Down

0 comments on commit a14b3f8

Please sign in to comment.