Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v38r0 (2143aa4c)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MessageSvc.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifdef _WIN32
12 // Avoid conflicts between windows and the message service.
13 # define NOMSG
14 # define NOGDI
15 #endif
16 
17 #include "MessageSvc.h"
18 #include "GaudiKernel/IAppMgrUI.h"
19 #include "GaudiKernel/Kernel.h"
20 #include "GaudiKernel/Message.h"
21 #include "GaudiKernel/StatusCode.h"
22 #include "GaudiKernel/System.h"
23 
24 #include <fstream>
25 #include <iostream>
26 #include <sstream>
27 
28 namespace {
29 
30  // erase_if functions for containers which do NOT invalidate iterators
31  // after the erase point, eg.std::{unordered_}{,multi}map, std::{forward_,}list.
32  // To be explicit: this does NOT work with std::vector.
33 
34  // TODO: replace with std::experimental::erase_if (Libraries Fundamental TS v2)
35 
36  template <typename Container, typename Iterator, typename Predicate>
37  void erase_if( Container& c, Iterator first, Iterator last, Predicate pred ) {
38  while ( first != last ) {
39  if ( pred( *first ) )
40  first = c.erase( first );
41  else
42  ++first;
43  }
44  }
45 
46  template <typename Container, typename Predicate>
47  void erase_if( Container& c, Predicate pred ) {
48  return erase_if( c, std::begin( c ), std::end( c ), std::forward<Predicate>( pred ) );
49  }
50 
51  template <typename Container, typename Iterator, typename Predicate>
52  void erase_if( Container& c, std::pair<Iterator, Iterator> range, Predicate pred ) {
53  return erase_if( c, std::move( range.first ), std::move( range.second ), std::forward<Predicate>( pred ) );
54  }
55 
56  std::string colTrans( std::string_view col, int offset ) {
57  int icol = ( col == "black" ? MSG::BLACK
58  : col == "red" ? MSG::RED
59  : col == "green" ? MSG::GREEN
60  : col == "yellow" ? MSG::YELLOW
61  : col == "blue" ? MSG::BLUE
62  : col == "purple" ? MSG::PURPLE
63  : col == "cyan" ? MSG::CYAN
64  : col == "white" ? MSG::WHITE
65  : 8 );
66  return std::to_string( icol + offset );
67  }
68 } // namespace
69 
70 // Instantiation of a static factory class used by clients to create
71 // instances of this service
73 
74 static const std::string levelNames[MSG::NUM_LEVELS] = { "NIL", "VERBOSE", "DEBUG", "INFO",
75  "WARNING", "ERROR", "FATAL", "ALWAYS" };
76 
77 // Constructor
79 
81  SmartIF<IAppMgrUI> app = svcloc;
82  if ( app ) app->outputLevelUpdate();
83  } );
84 
85 #ifndef NDEBUG
86  // initialize the MsgStream static flag.
88 #endif
89 
90  for ( int ic = 0; ic < MSG::NUM_LEVELS; ++ic ) {
91  m_logColors[ic].declareUpdateHandler( &MessageSvc::setupColors, this );
92  m_msgLimit[ic].declareUpdateHandler( &MessageSvc::setupLimits, this );
93  m_thresholdProp[ic].declareUpdateHandler( &MessageSvc::setupThreshold, this );
94  }
95 
96  m_logColors[MSG::FATAL].set( { "blue", "red" } );
97  m_logColors[MSG::ERROR].set( { "white", "red" } );
98  m_logColors[MSG::WARNING].set( { "yellow" } );
99 
101 }
102 
103 // #############################################################################
104 
108  if ( sc.isFailure() ) return sc;
109 
110 #ifdef _WIN32
111  m_color = false;
112 #endif
113 
114  // make sure the map of logged stream names is initialized
115  setupLogStreams();
116 
117  return StatusCode::SUCCESS;
118 }
119 
120 // #############################################################################
121 
125  StatusCode sc = initialize();
127 
128  return sc;
129 }
130 
131 // #############################################################################
132 
134  const auto& pname = prop.name();
135  int level =
136  ( pname == "fatalColorCode" ? MSG::FATAL
137  : pname == "errorColorCode" ? MSG::ERROR
138  : pname == "warningColorCode" ? MSG::WARNING
139  : pname == "infoColorCode" ? MSG::INFO
140  : pname == "debugColorCode" ? MSG::DEBUG
141  : pname == "verboseColorCode" ? MSG::VERBOSE
142  : pname == "alwaysColorCode"
143  ? MSG::ALWAYS
144  : ( throw GaudiException( "ERROR: Unknown message color parameter: " + pname, name(), StatusCode::FAILURE ),
145  -1 ) );
146 
147  auto& code = m_logColorCodes[level];
148 
149  const auto& col_desc = m_logColors[level].value();
150 
151  if ( col_desc.size() == 1 ) {
152  const std::string& desc = col_desc[0];
153  if ( desc.empty() ) {
154  code = "";
155  } else if ( desc[0] == '[' ) {
156  code = "\033" + desc;
157  } else {
158  code = "\033[" + colTrans( desc, 90 ) + ";1m";
159  }
160  } else if ( col_desc.size() == 2 ) {
161  code = "\033[" + colTrans( col_desc[0], 90 ) + ";" + colTrans( col_desc[1], 100 ) + ";1m";
162  } else { // empty desc: no color
163  code = "";
164  }
165 }
166 // #############################################################################
167 
169  // Just report problems in the settings of the limits and unknown limit parameters
170  if ( prop.name() == "alwaysLimit" ) {
171  Gaudi::Property<int>* p = dynamic_cast<Gaudi::Property<int>*>( &prop );
172  if ( p && p->value() != 0 ) {
173  std::cout << "MessageSvc ERROR: cannot suppress ALWAYS messages" << std::endl;
174  p->setValue( 0 );
175  }
176  } else if ( prop.name() == "defaultLimit" ) {
177  for ( int i = MSG::VERBOSE; i < MSG::NUM_LEVELS; ++i ) {
178  if ( i != MSG::ALWAYS ) { m_msgLimit[i] = m_msgLimit[MSG::NIL].value(); }
179  }
180  } else if ( prop.name() != "fatalLimit" && prop.name() != "errorLimit" && prop.name() != "warningLimit" &&
181  prop.name() == "infoLimit" && prop.name() == "debugLimit" && prop.name() == "verboseLimit" ) {
182  std::cout << "MessageSvc ERROR: Unknown message limit parameter: " << prop.name() << std::endl;
183  return;
184  }
185 }
186 // #############################################################################
187 
189 
190  static const std::array<std::pair<const char*, MSG::Level>, 7> tbl{ { { "setFatal", MSG::FATAL },
191  { "setError", MSG::ERROR },
192  { "setWarning", MSG::WARNING },
193  { "setInfo", MSG::INFO },
194  { "setDebug", MSG::DEBUG },
195  { "setVerbose", MSG::VERBOSE },
196  { "setAlways", MSG::ALWAYS } } };
197 
198  auto i = std::find_if( std::begin( tbl ), std::end( tbl ),
199  [&]( const std::pair<const char*, MSG::Level>& t ) { return prop.name() == t.first; } );
200  if ( i == std::end( tbl ) ) {
201  std::cerr << "MessageSvc ERROR: Unknown message threshold parameter: " << prop.name() << std::endl;
202  return;
203  }
204  int ic = i->second;
205 
207  if ( !sap ) {
208  std::cerr << "could not dcast " << prop.name()
209  << " to a Gaudi::Property<std::vector<std::string>> (which it should be!)" << std::endl;
210  } else {
211  for ( auto& i : sap->value() ) setOutputLevel( i, ic );
212  }
213 }
214 
215 // #############################################################################
216 
217 #ifdef NDEBUG
219 #else
221  if ( prop.name() == "countInactive" ) {
222  Gaudi::Property<bool>* p = dynamic_cast<Gaudi::Property<bool>*>( &prop );
223  if ( p ) MsgStream::enableCountInactive( p->value() );
224  }
225 }
226 #endif
227 
228 // #############################################################################
231 
232  m_suppress = false;
233 
234  {
236 
237  if ( m_stats ) {
238  os << "Summarizing all message counts" << std::endl;
239  } else {
240  os << "Listing sources of suppressed message: " << std::endl;
241  }
242 
243  os << "=====================================================" << std::endl;
244  os << " Message Source | Level | Count" << std::endl;
245  os << "-----------------------------+---------+-------------" << std::endl;
246 
247  bool found( false );
248 
249  for ( auto itr = m_sourceMap.begin(); itr != m_sourceMap.end(); ++itr ) {
250  for ( unsigned int ic = 0; ic < MSG::NUM_LEVELS; ++ic ) {
251  if ( ( itr->second.msg[ic] >= m_msgLimit[ic] && m_msgLimit[ic] != 0 ) ||
252  ( m_stats && itr->second.msg[ic] > 0 && ic >= m_statLevel.value() ) ) {
253  os << " ";
254  os.width( 28 );
255  os.setf( std::ios_base::left, std::ios_base::adjustfield );
256  os << itr->first;
257  os << "|";
258 
259  os.width( 8 );
260  os.setf( std::ios_base::right, std::ios_base::adjustfield );
261  os << levelNames[ic];
262  os << " |";
263 
264  os.width( 9 );
265  os << itr->second.msg[ic];
266  os << std::endl;
267 
268  found = true;
269  }
270  }
271  }
272  os << "=====================================================" << std::endl;
273  if ( found || m_stats ) std::cout << os.str() << std::flush;
274  }
275 
276 #ifndef NDEBUG
277  if ( m_inactCount.value() ) {
278 
280  os << "Listing sources of Unprotected and Unseen messages\n";
281 
282  bool found( false );
283 
284  unsigned int ml( 0 );
285  for ( const auto& itr : m_inactiveMap ) {
286  for ( unsigned int ic = 0; ic < MSG::NUM_LEVELS; ++ic ) {
287  if ( itr.second.msg[ic] != 0 && itr.first.length() > ml ) { ml = itr.first.length(); }
288  }
289  }
290 
291  for ( unsigned int i = 0; i < ml + 25; ++i ) os << "=";
292 
293  os << std::endl << " ";
294  os.width( ml + 2 );
295  os.setf( std::ios_base::left, std::ios_base::adjustfield );
296  os << "Message Source";
297  os.width( 1 );
298  os << "| Level | Count" << std::endl;
299 
300  for ( unsigned int i = 0; i < ml + 3; ++i ) os << "-";
301  os << "+---------+-----------" << std::endl;
302 
303  for ( auto itr = m_inactiveMap.begin(); itr != m_inactiveMap.end(); ++itr ) {
304  for ( unsigned int ic = 0; ic < MSG::NUM_LEVELS; ++ic ) {
305  if ( itr->second.msg[ic] != 0 ) {
306  os << " ";
307  os.width( ml + 2 );
308  os.setf( std::ios_base::left, std::ios_base::adjustfield );
309  os << itr->first;
310 
311  os << "|";
312 
313  os.width( 8 );
314  os.setf( std::ios_base::right, std::ios_base::adjustfield );
315  os << levelNames[ic];
316 
317  os << " |";
318 
319  os.width( 9 );
320  os << itr->second.msg[ic];
321 
322  os << std::endl;
323 
324  found = true;
325  }
326  }
327  }
328  for ( unsigned int i = 0; i < ml + 25; ++i ) os << "=";
329  os << std::endl;
330 
331  if ( found ) std::cout << os.str() << std::flush;
332  }
333 #endif
334 
335  return StatusCode::SUCCESS;
336 }
337 
338 // #############################################################################
339 // ---------------------------------------------------------------------------
340 // Routine: reportMessage
341 // Purpose: dispatches a message to the relevant streams.
342 // ---------------------------------------------------------------------------
343 //
344 void MessageSvc::reportMessage( const Message& msg, int outputLevel ) {
345  auto lock = std::scoped_lock{ m_reportMutex };
347 }
348 
349 void MessageSvc::i_reportMessage( const Message& msg, int outputLevel ) {
350  int key = msg.getType();
351 
352  ++m_msgCount[key];
353 
354  const Message* cmsg = &msg;
355 
356  // processing logged streams
357  if ( !m_loggedStreams.empty() ) {
358  auto iLog = m_loggedStreams.find( msg.getSource() );
359  if ( m_loggedStreams.end() != iLog ) { ( *iLog->second ) << *cmsg << std::endl; }
360  }
361 
362  if ( m_suppress.value() || m_stats.value() ) {
363 
364  // Increase the counter of 'key' type of messages for the source and
365  // get the new value.
366  const int nmsg = ++( m_sourceMap[msg.getSource()].msg[key] );
367 
368  if ( m_suppress.value() && m_msgLimit[key] != 0 ) {
369  if ( nmsg > m_msgLimit[key] ) return;
370  if ( nmsg == m_msgLimit[key] ) {
371  std::string txt = levelNames[key] + " message limit (" + std::to_string( m_msgLimit[key].value() ) +
372  ") reached for " + msg.getSource() + ". Suppressing further output.";
373  cmsg = new Message( msg.getSource(), MSG::WARNING, std::move( txt ) );
374  cmsg->setFormat( msg.getFormat() );
375  }
376  }
377  }
378 
379  auto range = m_streamMap.equal_range( key );
380  if ( range.first != m_streamMap.end() ) {
381  std::for_each( range.first, range.second,
382  [&]( StreamMap::const_reference sm ) { *sm.second.second << *cmsg << std::endl; } );
383  } else if ( key >= outputLevel ) {
384  msg.setFormat( m_defaultFormat );
385  msg.setTimeFormat( m_defaultTimeFormat );
386  if ( !m_color ) {
387  ( *m_defaultStream ) << *cmsg << std::endl << std::flush;
388  } else {
389  ( *m_defaultStream ) << m_logColorCodes[key] << *cmsg << "\033[m" << std::endl << std::flush;
390  }
391  }
392 
393  if ( cmsg != &msg ) { delete cmsg; }
394 }
395 
396 // #############################################################################
397 // ---------------------------------------------------------------------------
398 // Routine: reportMessage
399 // Purpose: dispatches a message to the relevant streams.
400 // ---------------------------------------------------------------------------
401 //
402 void MessageSvc::reportMessage( const Message& msg ) { reportMessage( msg, outputLevel( msg.getSource() ) ); }
403 
404 // #############################################################################
405 // ---------------------------------------------------------------------------
406 // Routine: reportMessage
407 // Purpose: dispatches a message to the relevant streams.
408 // ---------------------------------------------------------------------------
409 //
411  reportMessage( Message{ std::move( source ), type, std::move( message ) } );
412 }
413 
414 // #############################################################################
415 // ---------------------------------------------------------------------------
416 // Routine: sendMessage
417 // Purpose: finds a message for a given status code and dispatches it.
418 // ---------------------------------------------------------------------------
419 //
420 void MessageSvc::reportMessage( const StatusCode& code, std::string_view source ) {
421  auto lock = std::scoped_lock{ m_messageMapMutex };
422  i_reportMessage( code, source );
423 }
424 
425 void MessageSvc::i_reportMessage( const StatusCode& code, std::string_view source ) {
426  int level = outputLevel( source );
427  auto report = [&]( Message mesg ) {
428  mesg.setSource( source );
429  Message stat_code( std::string{ source }, mesg.getType(), "Status Code " + std::to_string( code.getCode() ) );
430  i_reportMessage( std::move( stat_code ), level );
431  i_reportMessage( std::move( mesg ), level );
432  };
433 
434  auto range = m_messageMap.equal_range( code );
435  if ( range.first != m_messageMap.end() ) {
436  std::for_each( range.first, range.second, [&]( MessageMap::const_reference sm ) { report( sm.second ); } );
437  } else {
438  report( m_defaultMessage );
439  }
440 }
441 
442 // #############################################################################
443 // ---------------------------------------------------------------------------
444 // Routine: insertStream
445 // Purpose: inserts a stream for a message type.
446 // ---------------------------------------------------------------------------
447 //
448 
451 }
452 
453 // #############################################################################
454 // ---------------------------------------------------------------------------
455 // Routine: eraseStream
456 // Purpose: erases all the streams for all the message types.
457 // ---------------------------------------------------------------------------
458 //
459 
461 
462 // #############################################################################
463 // ---------------------------------------------------------------------------
464 // Routine: eraseStream
465 // Purpose: erases all the streams for a message type.
466 // ---------------------------------------------------------------------------
467 //
468 
469 void MessageSvc::eraseStream( int message_type ) { m_streamMap.erase( message_type ); }
470 
471 // #############################################################################
472 // ---------------------------------------------------------------------------
473 // Routine: eraseStream
474 // Purpose: erases one stream for a message type.
475 // ---------------------------------------------------------------------------
476 //
477 
479  if ( stream ) {
480  erase_if( m_streamMap, m_streamMap.equal_range( key ),
481  [&]( StreamMap::const_reference j ) { return j.second.second == stream; } );
482  }
483 }
484 
485 // #############################################################################
486 // ---------------------------------------------------------------------------
487 // Routine: eraseStream
488 // Purpose: erases one stream for all message types.
489 // ---------------------------------------------------------------------------
490 //
491 
493  if ( stream ) {
494  erase_if( m_streamMap, [&]( StreamMap::const_reference j ) { return j.second.second == stream; } );
495  }
496 }
497 
498 // #############################################################################
499 // ---------------------------------------------------------------------------
500 // Routine: insertMessage
501 // Purpose: inserts a message for a status code.
502 // ---------------------------------------------------------------------------
503 //
504 
506  auto lock = std::scoped_lock{ m_messageMapMutex };
508 }
509 
510 // #############################################################################
511 // ---------------------------------------------------------------------------
512 // Routine: eraseMessage
513 // Purpose: erases all the messages for all the status codes.
514 // ---------------------------------------------------------------------------
515 //
516 
518  auto lock = std::scoped_lock{ m_messageMapMutex };
520 }
521 
522 // #############################################################################
523 // ---------------------------------------------------------------------------
524 // Routine: eraseMessage
525 // Purpose: erases all the messages for a status code.
526 // ---------------------------------------------------------------------------
527 //
528 
530  auto lock = std::scoped_lock{ m_messageMapMutex };
532 }
533 
534 // #############################################################################
535 // ---------------------------------------------------------------------------
536 // Routine: eraseMessage
537 // Purpose: erases one message for a status code.
538 // ---------------------------------------------------------------------------
539 //
540 
542  auto lock = std::scoped_lock{ m_messageMapMutex };
543 
545  [&]( MessageMap::const_reference j ) { return j.second == msg; } );
546 }
547 
548 // ---------------------------------------------------------------------------
550  // ---------------------------------------------------------------------------
551  return m_outputLevel;
552 }
553 
554 // ---------------------------------------------------------------------------
555 int MessageSvc::outputLevel( std::string_view source ) const {
556  // ---------------------------------------------------------------------------
557  auto lock = std::scoped_lock{ m_thresholdMapMutex };
558  auto it = m_thresholdMap.find( source );
559  return it != m_thresholdMap.end() ? it->second : m_outputLevel.value();
560 }
561 
562 // ---------------------------------------------------------------------------
563 void MessageSvc::setOutputLevel( int new_level ) {
564  // ---------------------------------------------------------------------------
565  m_outputLevel = new_level;
566 }
567 
568 // ---------------------------------------------------------------------------
569 void MessageSvc::setOutputLevel( std::string_view source, int level ) {
570  // ---------------------------------------------------------------------------
571  auto lock = std::scoped_lock{ m_thresholdMapMutex };
572 
573  // only write if we really have to...
574  auto i = m_thresholdMap.find( source );
575  if ( i == m_thresholdMap.end() ) {
576  m_thresholdMap.emplace( source, level );
577  } else if ( i->second != level ) {
578  i->second = level;
579  }
580 }
581 
582 // ---------------------------------------------------------------------------
583 std::string MessageSvc::getLogColor( int logLevel ) const {
584  // ---------------------------------------------------------------------------
585  return ( logLevel < MSG::NUM_LEVELS ) ? m_logColorCodes[logLevel] : "";
586 }
587 
588 // ---------------------------------------------------------------------------
590 
591 // ---------------------------------------------------------------------------
592 void MessageSvc::incrInactiveCount( MSG::Level level, std::string_view source ) {
593  auto entry = m_inactiveMap.find( source );
594  if ( entry == m_inactiveMap.end() ) { entry = m_inactiveMap.emplace( source, MsgAry{} ).first; }
595  ++entry->second.msg[level];
596 
599  std::cout << "== inactive message detected from " << source << " ==\n";
600  std::string t;
601  System::backTrace( t, 25, 0 );
602  std::cout << t << std::endl;
603  }
604 }
605 
606 // ---------------------------------------------------------------------------
607 
609  // reset state
611 
612  // make the unique set of output filenames
613  std::set<std::string_view> outFileNames;
615  std::inserter( outFileNames, outFileNames.end() ),
616  []( const auto& p ) -> std::string_view { return p.second; } );
617  // map each unique filename to an ofstream
619  std::transform( outFileNames.begin(), outFileNames.end(), std::inserter( outStreams, outStreams.end() ),
620  []( std::string_view fname ) {
621  return std::pair{ fname, std::make_shared<std::ofstream>(
622  std::string{ fname }, std::ios_base::out | std::ios_base::trunc ) };
623  } );
624  // associate the stream to ofstream...
625  for ( auto& iProp : m_loggedStreamsName ) {
626  auto& stream = outStreams.at( iProp.second );
627  if ( stream->good() ) m_loggedStreams.emplace( iProp.first, stream );
628  }
629 }
630 
631 // ---------------------------------------------------------------------------
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:25
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: PropertyBase.h:35
std::ostringstream::width
T width(T... args)
GaudiHive.precedence.message
message
Definition: precedence.py:19
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: PropertyBase.h:39
MessageSvc::reinitialize
StatusCode reinitialize() override
Reinitialize Service.
Definition: MessageSvc.cpp:123
MessageSvc::m_logColors
std::array< Gaudi::Property< std::vector< std::string > >, MSG::NUM_LEVELS > m_logColors
Definition: MessageSvc.h:153
std::for_each
T for_each(T... args)
Write.stream
stream
Definition: Write.py:32
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:118
MessageSvc::setupLimits
void setupLimits(Gaudi::Details::PropertyBase &prop)
Definition: MessageSvc.cpp:168
std::string
STL class.
MessageSvc::m_stats
Gaudi::Property< bool > m_stats
Definition: MessageSvc.h:139
MsgStream::enableCountInactive
static GAUDI_API bool enableCountInactive(bool value=true)
Enable/disable the count of inactive messages.
Definition: MsgStream.cpp:41
Read.app
app
Definition: Read.py:36
std::move
T move(T... args)
bug_34121.name
name
Definition: bug_34121.py:20
Service::m_state
Gaudi::StateMachine::State m_state
Service state
Definition: Service.h:200
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
MSG::INFO
@ INFO
Definition: IMessageSvc.h:25
System.h
std::pair
MessageSvc::MsgAry
Private helper class to keep the count of messages of a type (MSG::LEVEL).
Definition: MessageSvc.h:192
MessageSvc::m_defaultTimeFormat
Gaudi::Property< std::string > m_defaultTimeFormat
Definition: MessageSvc.h:138
MSG::BLACK
@ BLACK
Definition: IMessageSvc.h:26
MessageSvc::insertMessage
void insertMessage(const StatusCode &code, Message message) override
Definition: MessageSvc.cpp:505
std::find_if
T find_if(T... args)
ISvcLocator
Definition: ISvcLocator.h:46
GaudiException
Definition: GaudiException.h:31
MessageSvc::incrInactiveCount
void incrInactiveCount(MSG::Level level, std::string_view src) override
Definition: MessageSvc.cpp:592
MessageSvc::reportMessage
void reportMessage(const Message &message) override
Definition: MessageSvc.cpp:402
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:19
std::multimap::emplace
T emplace(T... args)
MessageSvc::m_logColorCodes
std::string m_logColorCodes[MSG::NUM_LEVELS]
Definition: MessageSvc.h:189
MessageSvc::m_reportMutex
std::recursive_mutex m_reportMutex
Mutex to synchronize multiple threads printing.
Definition: MessageSvc.h:213
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:25
MessageSvc.h
MSG::BLUE
@ BLUE
Definition: IMessageSvc.h:26
MessageSvc::i_reportMessage
virtual void i_reportMessage(const Message &msg, int outputLevel)
Internal implementation of reportMessage(const Message&,int) without lock.
Definition: MessageSvc.cpp:349
gaudirun.c
c
Definition: gaudirun.py:525
MessageSvc::messageCount
int messageCount(MSG::Level logLevel) const override
Definition: MessageSvc.cpp:589
System::backTrace
GAUDI_API int backTrace(void **addresses, const int depth)
StatusCode.h
IAppMgrUI.h
std::multimap::clear
T clear(T... args)
std::fill
T fill(T... args)
Gaudi::Property::setValue
bool setValue(const ValueType &v)
Definition: Property.h:241
MessageSvc::m_streamMap
StreamMap m_streamMap
Stream map.
Definition: MessageSvc.h:185
MessageSvc::m_thresholdMapMutex
std::recursive_mutex m_thresholdMapMutex
Mutex to synchronize multiple access to m_thresholdMap (.
Definition: MessageSvc.h:220
MSG::PURPLE
@ PURPLE
Definition: IMessageSvc.h:26
MessageSvc::m_msgLimit
std::array< Gaudi::Property< int >, MSG::NUM_LEVELS > m_msgLimit
Definition: MessageSvc.h:162
bug_34121.t
t
Definition: bug_34121.py:30
MessageSvc::m_statLevel
Gaudi::Property< unsigned int > m_statLevel
Definition: MessageSvc.h:140
Service::name
const std::string & name() const override
Retrieve name of the service
Definition: Service.cpp:332
StatusCode
Definition: StatusCode.h:65
Message
Definition: Message.h:26
ProduceConsume.j
j
Definition: ProduceConsume.py:101
std::cout
CLHEP::begin
double * begin(CLHEP::HepVector &v)
Definition: TupleAlg.cpp:45
MessageSvc::m_sourceMap
std::map< std::string, MsgAry, std::less<> > m_sourceMap
Definition: MessageSvc.h:199
CommonMessaging
Definition: CommonMessaging.h:66
Gaudi::StateMachine::OFFLINE
@ OFFLINE
Definition: StateMachine.h:23
Gaudi::Property::declareUpdateHandler
Details::PropertyBase & declareUpdateHandler(std::function< void(Details::PropertyBase &)> fun) override
set new callback for update
Definition: Property.h:146
MessageSvc::m_msgCount
std::array< int, MSG::NUM_LEVELS > m_msgCount
Definition: MessageSvc.h:201
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:239
std::to_string
T to_string(T... args)
Message::setFormat
void setFormat(std::string msg) const
Set the format string.
Definition: Message.cpp:97
std::array
STL class.
MessageSvc::m_defaultMessage
Message m_defaultMessage
Default Message.
Definition: MessageSvc.h:184
MessageSvc::m_thresholdMap
ThresholdMap m_thresholdMap
Output level threshold map.
Definition: MessageSvc.h:187
std::ostringstream::setf
T setf(T... args)
std::flush
T flush(T... args)
std::multimap::erase
T erase(T... args)
SmartIF< IAppMgrUI >
std::map
STL class.
MessageSvc::m_messageMap
MessageMap m_messageMap
Message map.
Definition: MessageSvc.h:186
MessageSvc::setupThreshold
void setupThreshold(Gaudi::Details::PropertyBase &prop)
Definition: MessageSvc.cpp:188
gaudirun.level
level
Definition: gaudirun.py:364
std::transform
T transform(T... args)
MessageSvc::m_tracedInactiveSources
Gaudi::Property< std::vector< std::string > > m_tracedInactiveSources
Definition: MessageSvc.h:174
MSG::FATAL
@ FATAL
Definition: IMessageSvc.h:25
MessageSvc::m_inactiveMap
std::map< std::string, MsgAry, std::less<> > m_inactiveMap
Definition: MessageSvc.h:199
MessageSvc
Definition: MessageSvc.h:40
MessageSvc::outputLevel
int outputLevel() const override
Definition: MessageSvc.cpp:549
std::ostringstream
STL class.
MessageSvc::finalize
StatusCode finalize() override
Finalize Service.
Definition: MessageSvc.cpp:230
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
MSG::RED
@ RED
Definition: IMessageSvc.h:26
MessageSvc::m_inactCount
Gaudi::Property< bool > m_inactCount
Definition: MessageSvc.h:172
MSG::Level
Level
Definition: IMessageSvc.h:25
std::multimap::equal_range
T equal_range(T... args)
gaudirun.type
type
Definition: gaudirun.py:160
MSG::VERBOSE
@ VERBOSE
Definition: IMessageSvc.h:25
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
std::endl
T endl(T... args)
MessageSvc::m_messageMapMutex
std::recursive_mutex m_messageMapMutex
Mutex to synchronize multiple access to m_messageMap.
Definition: MessageSvc.h:216
MSG::WHITE
@ WHITE
Definition: IMessageSvc.h:26
MessageSvc::NamedStream
std::pair< std::string, std::ostream * > NamedStream
Definition: MessageSvc.h:42
MessageSvc::m_loggedStreamsName
Gaudi::Property< std::map< std::string, std::string, std::less<> > > m_loggedStreamsName
Definition: MessageSvc.h:180
MSG::ALWAYS
@ ALWAYS
Definition: IMessageSvc.h:25
MessageSvc::setupInactCount
void setupInactCount(Gaudi::Details::PropertyBase &prop)
Definition: MessageSvc.cpp:220
std::begin
T begin(T... args)
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
MessageSvc::eraseMessage
void eraseMessage() override
Definition: MessageSvc.cpp:517
MSG::NIL
@ NIL
Definition: IMessageSvc.h:25
Kernel.h
Gaudi::StateMachine::INITIALIZED
@ INITIALIZED
Definition: StateMachine.h:25
ProduceConsume.Message
Message
Definition: ProduceConsume.py:107
MSG::ERROR
@ ERROR
Definition: IMessageSvc.h:25
MSG::CYAN
@ CYAN
Definition: IMessageSvc.h:26
MSG::GREEN
@ GREEN
Definition: IMessageSvc.h:26
std::string::empty
T empty(T... args)
MessageSvc::m_color
Gaudi::Property< bool > m_color
Definition: MessageSvc.h:151
StatusCode::getCode
code_t getCode() const
Retrieve value.
Definition: StatusCode.h:136
compareOutputFiles.pname
pname
Definition: compareOutputFiles.py:481
MessageSvc::m_loggedStreams
std::map< std::string, std::shared_ptr< std::ostream >, std::less<> > m_loggedStreams
Definition: MessageSvc.h:203
std::ostringstream::str
T str(T... args)
MessageSvc::initialize
StatusCode initialize() override
Initialize Service.
Definition: MessageSvc.cpp:106
std::end
T end(T... args)
IOTest.end
end
Definition: IOTest.py:123
MessageSvc::getLogColor
std::string getLogColor(int logLevel) const override
Definition: MessageSvc.cpp:583
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
MessageSvc::eraseStream
void eraseStream() override
Definition: MessageSvc.cpp:460
MessageSvc::m_thresholdProp
std::array< Gaudi::Property< std::vector< std::string > >, MSG::NUM_LEVELS > m_thresholdProp
Definition: MessageSvc.h:142
MessageSvc::setupLogStreams
void setupLogStreams()
Definition: MessageSvc.cpp:608
MessageSvc::MessageSvc
MessageSvc(const std::string &name, ISvcLocator *svcloc)
Definition: MessageSvc.cpp:78
MessageSvc::m_suppress
Gaudi::Property< bool > m_suppress
Definition: MessageSvc.h:171
MSG::NUM_LEVELS
@ NUM_LEVELS
Definition: IMessageSvc.h:25
std::inserter
T inserter(T... args)
MessageSvc::insertStream
void insertStream(int message_type, std::string name, std::ostream *stream) override
Definition: MessageSvc.cpp:449
MessageSvc::m_defaultFormat
Gaudi::Property< std::string > m_defaultFormat
Definition: MessageSvc.h:137
MessageSvc::setOutputLevel
void setOutputLevel(int new_level) override
Definition: MessageSvc.cpp:563
ProduceConsume.key
key
Definition: ProduceConsume.py:81
Service::m_outputLevel
Gaudi::Property< int > m_outputLevel
flag indicating whether ToolHandle tools have been added to m_tools
Definition: Service.h:229
std::set
STL class.
Gaudi::Property< int >
MSG::YELLOW
@ YELLOW
Definition: IMessageSvc.h:26
Gaudi::Functional::details::zip::range
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.
Definition: details.h:98
Message.h
Iterator
boost::spirit::classic::position_iterator2< ForwardIterator > Iterator
Definition: Iterator.h:28
MessageSvc::setupColors
void setupColors(Gaudi::Details::PropertyBase &prop)
Definition: MessageSvc.cpp:133