The Gaudi Framework  master (01b473db)
CommonMessaging< BASE > Class Template Reference

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/CommonMessaging.h>

Public Types

using base_class = CommonMessaging
 

Public Member Functions

MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream) More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 

Protected Member Functions

MSG::Level setUpMessaging () const
 Set up local caches. More...
 
MSG::Level resetMessaging ()
 Reinitialize internal states. More...
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Private Member Functions

void create_msgStream () const override final
 
void initMessaging () const
 Initialise the messaging objects. More...
 

Detailed Description

template<typename BASE>
class CommonMessaging< BASE >

Definition at line 65 of file CommonMessaging.h.

Member Typedef Documentation

◆ base_class

template<typename BASE >
using CommonMessaging< BASE >::base_class = CommonMessaging

Definition at line 141 of file CommonMessaging.h.

Member Function Documentation

◆ create_msgStream()

template<typename BASE >
void CommonMessaging< BASE >::create_msgStream ( ) const
inlinefinaloverrideprivate

Definition at line 157 of file CommonMessaging.h.

157 { m_msgStream.reset( new MsgStream( msgSvc(), this->name() ) ); }

◆ initMessaging()

template<typename BASE >
void CommonMessaging< BASE >::initMessaging ( ) const
inlineprivate

Initialise the messaging objects.

Definition at line 160 of file CommonMessaging.h.

160  {
161  if ( !m_msgsvc ) {
162  // Get default implementation of the message service.
163  m_msgsvc = this->serviceLocator();
164  }
166  m_level = MSG::Level( m_msgStream.get() ? m_msgStream->level() : MSG::NIL );
167  // if we could not get a MessageSvc, we should try again the initial set up
168  m_commonMessagingReady = m_msgsvc;
169  }

◆ msgLevel() [1/2]

template<typename BASE >
MSG::Level CommonMessaging< BASE >::msgLevel ( ) const
inline

get the cached level (originally extracted from the embedded MsgStream)

Definition at line 147 of file CommonMessaging.h.

147  {
148  if ( m_commonMessagingReady ) return m_level;
149  return setUpMessaging();
150  }

◆ msgLevel() [2/2]

template<typename BASE >
bool CommonMessaging< BASE >::msgLevel ( MSG::Level  lvl) const
inline

get the output level from the embedded MsgStream

Definition at line 153 of file CommonMessaging.h.

153 { return msgLevel() <= lvl; }

◆ resetMessaging()

template<typename BASE >
MSG::Level CommonMessaging< BASE >::resetMessaging ( )
inlineprotected

Reinitialize internal states.

Definition at line 178 of file CommonMessaging.h.

178  {
179  m_commonMessagingReady = false;
180  return setUpMessaging();
181  }

◆ setUpMessaging()

template<typename BASE >
MSG::Level CommonMessaging< BASE >::setUpMessaging ( ) const
inlineprotected

Set up local caches.

Definition at line 173 of file CommonMessaging.h.

173  {
174  if ( !m_commonMessagingReady ) { initMessaging(); }
175  return m_level;
176  }

◆ updateMsgStreamOutputLevel()

template<typename BASE >
void CommonMessaging< BASE >::updateMsgStreamOutputLevel ( int  level)
inlineprotected

Update the output level of the cached MsgStream.

This function is meant to be called by the update handler of the OutputLevel property.

Definition at line 184 of file CommonMessaging.h.

184  {
185  setUpMessaging();
186  if ( level != MSG::NIL && level != m_level ) {
187  if ( msgSvc() ) msgSvc()->setOutputLevel( this->name(), level );
188  if ( m_msgStream.get() ) m_msgStream->setLevel( level );
189  if ( MSG::Level( level ) <= MSG::DEBUG )
190  debug() << "Property update for OutputLevel : new value = " << level << endmsg;
191  m_level = MSG::Level( level );
192  }
193  }

The documentation for this class was generated from the following file:
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:22
CommonMessaging::create_msgStream
void create_msgStream() const override final
Definition: CommonMessaging.h:157
CommonMessaging::initMessaging
void initMessaging() const
Initialise the messaging objects.
Definition: CommonMessaging.h:160
CommonMessaging::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition: CommonMessaging.h:147
AvalancheSchedulerErrorTest.msgSvc
msgSvc
Definition: AvalancheSchedulerErrorTest.py:80
CommonMessaging::setUpMessaging
MSG::Level setUpMessaging() const
Set up local caches.
Definition: CommonMessaging.h:173
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:198
gaudirun.level
level
Definition: gaudirun.py:364
MsgStream
Definition: MsgStream.h:29
MSG::Level
Level
Definition: IMessageSvc.h:22
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
MSG::NIL
@ NIL
Definition: IMessageSvc.h:22