The Gaudi Framework  master (594c33fa)
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 66 of file CommonMessaging.h.

Member Typedef Documentation

◆ base_class

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

Definition at line 142 of file CommonMessaging.h.

Member Function Documentation

◆ create_msgStream()

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

Definition at line 158 of file CommonMessaging.h.

158 { 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 161 of file CommonMessaging.h.

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

◆ 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 148 of file CommonMessaging.h.

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

◆ 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 154 of file CommonMessaging.h.

154 { return msgLevel() <= lvl; }

◆ resetMessaging()

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

Reinitialize internal states.

Definition at line 179 of file CommonMessaging.h.

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

◆ setUpMessaging()

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

Set up local caches.

Definition at line 174 of file CommonMessaging.h.

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

◆ 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 185 of file CommonMessaging.h.

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

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