Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::TraceMng Class Reference

Public Member Functions

 ARCCORE_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS ()
TraceMessage operator() ()
TraceMessage info () override
 Stream for an information message.
TraceMessage info (char) override
 Stream for an information message of a given category.
TraceMessage info (Int32 verbose_level) override
 Stream for an information message of a given level.
TraceMessage pinfo () override
 Stream for a parallel information message.
TraceMessage pinfo (char) override
 Stream for a parallel information message of a given category.
TraceMessage info (bool is_ok) override
 Stream for a conditional information message.
TraceMessage warning () override
 Stream for a warning message.
TraceMessage pwarning () override
 Stream for a parallel warning message.
TraceMessage error () override
 Stream for an error message.
TraceMessage perror () override
 Stream for a parallel error message.
TraceMessage log () override
 Stream for a log message.
TraceMessage plog () override
 Stream for a parallel log message.
TraceMessage logdate () override
 Stream for a log message preceded by the time.
TraceMessage fatal () override
 Stream for a fatal error message.
TraceMessage pfatal () override
 Stream for a parallel fatal error message.
TraceMessage devNull () override
 Stream for an unused message.
TraceMessageDbg debug (Trace::eDebugLevel dbg_lvl) override
 Stream for a debug message.
void endTrace (const TraceMessage *msg) override
 Signals the end of writing message message.
void beginTrace (const TraceMessage *msg) override
 Signals the start of writing message message.
void putTrace (const String &message, int type) override
 Directly sends a message of type type.
void addListener (ITraceMessageListener *v) override
 Adds observer v to this message manager.
void removeListener (ITraceMessageListener *v) override
 Removes observer v from this message manager.
bool setInfoActivated (bool v) override
 Modifies the activation state of info messages.
bool isInfoActivated () const override
 Indicates if info message outputs are activated.
void finishInitialize () override
 Finishes the initialization of the trace manager.
void pushTraceClass (const String &name) override
 Adds class s to the stack of active message classes. \threadsafe.
void popTraceClass () override
 Removes the last message class from the stack. \threadsafe.
void flush () override
 Flushes all streams.
void setRedirectStream (std::ostream *ro) override
 Redirects all messages to the stream o.
void setRedirectStream (ITraceStream *stream) override
 Redirects all messages to the stream o.
Trace::eDebugLevel configDbgLevel () const override
 Returns the dbg level of the configuration file.
void setErrorFileName (const String &file_name) override
 Sets the error file name to file_name.
void setLogFileName (const String &file_name) override
 Sets the log file name to file_name.
void setClassConfig (const String &name, const TraceClassConfig &config) override
 Sets the configuration for the message class name.
TraceClassConfig classConfig (const String &name) const override
 Configuration associated with the message class name.
void removeAllClassConfig () override
 Removes all configuration classes set via setClassConfig().
void setMaster (bool is_master) override
 Sets the 'master' state of the instance.
bool isMaster () const override
void setVerbosityLevel (Int32 level) override
 Sets the verbosity level of the outputs.
Int32 verbosityLevel () const override
 Message verbosity level.
void setStandardOutputVerbosityLevel (Int32 level) override
 Sets the verbosity level of outputs on std::cout.
Int32 standardOutputVerbosityLevel () const override
 Message verbosity level on std::cout.
void resetThreadStatus () override
void writeDirect (const TraceMessage *msg, const String &str) override
 Writes a message directly.
void setTraceId (const String &id) override
 Sets the manager identifier.
const StringtraceId () const override
 Manager identifier.
void visitClassConfigs (IFunctorWithArgumentT< std::pair< String, TraceClassConfig > > *functor) override
Public Member Functions inherited from Arcane::ReferenceCounterImpl
void addReference ()
void removeReference ()
void _internalAddReference ()
bool _internalRemoveReference ()
Public Member Functions inherited from Arcane::ITraceMng
virtual ARCCORE_DEPRECATED_2018 bool setActivated (bool v)
void fatalMessage (const StandaloneTraceMessage &o)
 Performs a fatal() on an already manufactured message.

Protected Member Functions

TraceMessage _log (bool print_date)
TraceMessage _info ()
TraceMessage _info (Int32 verbose_level)
TraceMessage _devNull ()
TraceMessageDbg _dbg ()
TraceMessageDbg _dbgDevNull ()
bool _isCurrentClassActivated () const
bool _isCurrentClassParallelActivated () const
Trace::eDebugLevel _configDbgLevel () const

Detailed Description

Definition at line 212 of file arccore/src/trace/arccore/trace/TraceMng.cc.

Constructor & Destructor Documentation

◆ TraceMng()

Arcane::TraceMng::TraceMng ( )

Definition at line 542 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ ~TraceMng()

Arcane::TraceMng::~TraceMng ( )
overrideprotected

Definition at line 554 of file arccore/src/trace/arccore/trace/TraceMng.cc.

Member Function Documentation

◆ _configDbgLevel()

Trace::eDebugLevel Arcane::TraceMng::_configDbgLevel ( ) const
inlineprotected

Definition at line 417 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ _dbg()

TraceMessageDbg Arcane::TraceMng::_dbg ( )
inlineprotected

Definition at line 393 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ _dbgDevNull()

TraceMessageDbg Arcane::TraceMng::_dbgDevNull ( )
inlineprotected

Definition at line 394 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ _devNull()

TraceMessage Arcane::TraceMng::_devNull ( )
inlineprotected

Definition at line 379 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ _info() [1/2]

TraceMessage Arcane::TraceMng::_info ( )
inlineprotected

Definition at line 371 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ _info() [2/2]

TraceMessage Arcane::TraceMng::_info ( Int32 verbose_level)
inlineprotected

Definition at line 375 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ _isCurrentClassActivated()

bool Arcane::TraceMng::_isCurrentClassActivated ( ) const
inlineprotected

Definition at line 397 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ _isCurrentClassParallelActivated()

bool Arcane::TraceMng::_isCurrentClassParallelActivated ( ) const
inlineprotected

Definition at line 407 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ _log()

TraceMessage Arcane::TraceMng::_log ( bool print_date)
inlineprotected

Definition at line 362 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ addListener()

void Arcane::TraceMng::addListener ( ITraceMessageListener * v)
overridevirtual

Adds observer v to this message manager.

The caller remains the owner of v and must remove it via removeListener() before destroying it.

Implements Arcane::ITraceMng.

Definition at line 1311 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ beginTrace()

void Arcane::TraceMng::beginTrace ( const TraceMessage * message)
overridevirtual

Signals the start of writing message message.

Implements Arcane::ITraceMng.

Definition at line 955 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ classConfig()

TraceClassConfig Arcane::TraceMng::classConfig ( const String & name) const
overridevirtual

Configuration associated with the message class name.

Implements Arcane::ITraceMng.

Definition at line 1236 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ configDbgLevel()

Trace::eDebugLevel Arcane::TraceMng::configDbgLevel ( ) const
inlineoverridevirtual

Returns the dbg level of the configuration file.

Implements Arcane::ITraceMng.

Definition at line 333 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ debug()

TraceMessageDbg Arcane::TraceMng::debug ( Trace::eDebugLevel )
inlineoverridevirtual

Stream for a debug message.

Implements Arcane::ITraceMng.

Definition at line 298 of file arccore/src/trace/arccore/trace/TraceMng.cc.

Referenced by putTrace().

◆ devNull()

TraceMessage Arcane::TraceMng::devNull ( )
inlineoverridevirtual

Stream for an unused message.

Implements Arcane::ITraceMng.

Definition at line 294 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ endTrace()

void Arcane::TraceMng::endTrace ( const TraceMessage * message)
overridevirtual

Signals the end of writing message message.

Implements Arcane::ITraceMng.

Definition at line 969 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ error()

TraceMessage Arcane::TraceMng::error ( )
inlineoverridevirtual

Stream for an error message.

Implements Arcane::ITraceMng.

Definition at line 266 of file arccore/src/trace/arccore/trace/TraceMng.cc.

Referenced by perror(), and putTrace().

◆ fatal()

TraceMessage Arcane::TraceMng::fatal ( )
inlineoverridevirtual

Stream for a fatal error message.

Implements Arcane::ITraceMng.

Definition at line 286 of file arccore/src/trace/arccore/trace/TraceMng.cc.

Referenced by putTrace().

◆ finishInitialize()

void Arcane::TraceMng::finishInitialize ( )
overridevirtual

Finishes the initialization of the trace manager.

Implements Arcane::ITraceMng.

Definition at line 1196 of file arccore/src/trace/arccore/trace/TraceMng.cc.

References Arcane::Platform::removeFile().

◆ flush()

void Arcane::TraceMng::flush ( )
overridevirtual

Flushes all streams.

Implements Arcane::ITraceMng.

Definition at line 612 of file arccore/src/trace/arccore/trace/TraceMng.cc.

Referenced by popTraceClass().

◆ info() [1/4]

TraceMessage Arcane::TraceMng::info ( )
inlineoverridevirtual

Stream for an information message.

Implements Arcane::ITraceMng.

Definition at line 234 of file arccore/src/trace/arccore/trace/TraceMng.cc.

Referenced by putTrace().

◆ info() [2/4]

TraceMessage Arcane::TraceMng::info ( bool )
inlineoverridevirtual

Stream for a conditional information message.

Implements Arcane::ITraceMng.

Definition at line 254 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ info() [3/4]

TraceMessage Arcane::TraceMng::info ( char category)
inlineoverridevirtual

Stream for an information message of a given category.

Implements Arcane::ITraceMng.

Definition at line 238 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ info() [4/4]

TraceMessage Arcane::TraceMng::info ( Int32 level)
inlineoverridevirtual

Stream for an information message of a given level.

Implements Arcane::ITraceMng.

Definition at line 242 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ isInfoActivated()

bool Arcane::TraceMng::isInfoActivated ( ) const
inlineoverridevirtual

Indicates if info message outputs are activated.

Implements Arcane::ITraceMng.

Definition at line 315 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ isMaster()

bool Arcane::TraceMng::isMaster ( ) const
inlineoverridevirtual

Implements Arcane::ITraceMng.

Definition at line 343 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ log()

TraceMessage Arcane::TraceMng::log ( )
inlineoverridevirtual

Stream for a log message.

Implements Arcane::ITraceMng.

Definition at line 274 of file arccore/src/trace/arccore/trace/TraceMng.cc.

Referenced by putTrace().

◆ logdate()

TraceMessage Arcane::TraceMng::logdate ( )
inlineoverridevirtual

Stream for a log message preceded by the time.

Implements Arcane::ITraceMng.

Definition at line 282 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ operator()()

TraceMessage Arcane::TraceMng::operator() ( )
inline

Definition at line 230 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ perror()

TraceMessage Arcane::TraceMng::perror ( )
inlineoverridevirtual

Stream for a parallel error message.

Implements Arcane::ITraceMng.

Definition at line 270 of file arccore/src/trace/arccore/trace/TraceMng.cc.

References error().

◆ pfatal()

TraceMessage Arcane::TraceMng::pfatal ( )
inlineoverridevirtual

Stream for a parallel fatal error message.

Implements Arcane::ITraceMng.

Definition at line 290 of file arccore/src/trace/arccore/trace/TraceMng.cc.

Referenced by putTrace().

◆ pinfo() [1/2]

TraceMessage Arcane::TraceMng::pinfo ( )
inlineoverridevirtual

Stream for a parallel information message.

Implements Arcane::ITraceMng.

Definition at line 246 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ pinfo() [2/2]

TraceMessage Arcane::TraceMng::pinfo ( char category)
inlineoverridevirtual

Stream for a parallel information message of a given category.

Implements Arcane::ITraceMng.

Definition at line 250 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ plog()

TraceMessage Arcane::TraceMng::plog ( )
inlineoverridevirtual

Stream for a parallel log message.

Implements Arcane::ITraceMng.

Definition at line 278 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ popTraceClass()

void Arcane::TraceMng::popTraceClass ( )
overridevirtual

Removes the last message class from the stack. \threadsafe.

Implements Arcane::ITraceMng.

Definition at line 1180 of file arccore/src/trace/arccore/trace/TraceMng.cc.

References flush().

◆ pushTraceClass()

void Arcane::TraceMng::pushTraceClass ( const String & name)
overridevirtual

Adds class s to the stack of active message classes. \threadsafe.

Implements Arcane::ITraceMng.

Definition at line 1167 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ putTrace()

void Arcane::TraceMng::putTrace ( const String & message,
int type )
overridevirtual

Directly sends a message of type type.

type must correspond to Trace::eMessageType. This method should only be used by the .NET wrapping.

Implements Arcane::ITraceMng.

Definition at line 986 of file arccore/src/trace/arccore/trace/TraceMng.cc.

References debug(), error(), fatal(), info(), log(), Arcane::Trace::Medium, pfatal(), and warning().

◆ pwarning()

TraceMessage Arcane::TraceMng::pwarning ( )
inlineoverridevirtual

Stream for a parallel warning message.

Implements Arcane::ITraceMng.

Definition at line 262 of file arccore/src/trace/arccore/trace/TraceMng.cc.

References warning().

◆ removeAllClassConfig()

void Arcane::TraceMng::removeAllClassConfig ( )
overridevirtual

Removes all configuration classes set via setClassConfig().

Implements Arcane::ITraceMng.

Definition at line 1246 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ removeListener()

void Arcane::TraceMng::removeListener ( ITraceMessageListener * v)
overridevirtual

Removes observer v from this message manager.

Implements Arcane::ITraceMng.

Definition at line 1322 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ resetThreadStatus()

void Arcane::TraceMng::resetThreadStatus ( )
overridevirtual

Implements Arcane::ITraceMng.

Definition at line 1303 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ setClassConfig()

void Arcane::TraceMng::setClassConfig ( const String & name,
const TraceClassConfig & config )
overridevirtual

Sets the configuration for the message class name.

Implements Arcane::ITraceMng.

Definition at line 1211 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ setErrorFileName()

void Arcane::TraceMng::setErrorFileName ( const String & file_name)
overridevirtual

Sets the error file name to file_name.

If an error file is already open, it is closed and a new one with this new file name will be created upon the next error.

If file_name is the null string, no error file is used.

Implements Arcane::ITraceMng.

Definition at line 638 of file arccore/src/trace/arccore/trace/TraceMng.cc.

References Arcane::String::null().

◆ setInfoActivated()

bool Arcane::TraceMng::setInfoActivated ( bool v)
inlineoverridevirtual

Modifies the activation state of info messages.

Returns
the previous activation state.

Implements Arcane::ITraceMng.

Definition at line 309 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ setLogFileName()

void Arcane::TraceMng::setLogFileName ( const String & file_name)
overridevirtual

Sets the log file name to file_name.

If a log file is already open, it is closed and a new one with this new file name will be created upon the next log.

If file_name is the null string, no log file is used.

Implements Arcane::ITraceMng.

Definition at line 653 of file arccore/src/trace/arccore/trace/TraceMng.cc.

References Arcane::String::null().

◆ setMaster()

void Arcane::TraceMng::setMaster ( bool is_master)
overridevirtual

Sets the 'master' state of the instance.

Instances that have this attribute set to true display messages on std::cout as well as the messages perror() and pwarning(). It is therefore preferable that there be only one master ITraceMng instance.

Implements Arcane::ITraceMng.

Definition at line 1276 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ setRedirectStream() [1/2]

void Arcane::TraceMng::setRedirectStream ( ITraceStream * o)
inlineoverridevirtual

Redirects all messages to the stream o.

Implements Arcane::ITraceMng.

Definition at line 328 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ setRedirectStream() [2/2]

void Arcane::TraceMng::setRedirectStream ( std::ostream * o)
inlineoverridevirtual

Redirects all messages to the stream o.

Deprecated
Use the setRedirectStream(ITraceStream*) overload.

Implements Arcane::ITraceMng.

Definition at line 324 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ setStandardOutputVerbosityLevel()

void Arcane::TraceMng::setStandardOutputVerbosityLevel ( Int32 level)
overridevirtual

Sets the verbosity level of outputs on std::cout.

This property is only used if isMaster() is true and if the listings outputs have been redirected. Otherwise, the property verbosityLevel() is used.

Implements Arcane::ITraceMng.

Definition at line 1294 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ setTraceId()

void Arcane::TraceMng::setTraceId ( const String & id)
inlineoverridevirtual

Sets the manager identifier.

If not null, the identifier is displayed in case of an error to identify the instance displaying the message. The identifier can be arbitrary. By default, it is the process rank and the machine name.

Implements Arcane::ITraceMng.

Definition at line 355 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ setVerbosityLevel()

void Arcane::TraceMng::setVerbosityLevel ( Int32 level)
overridevirtual

Sets the verbosity level of the outputs.

Messages at a level higher than this level are not outputted. The level used is the one given as an argument to info(Int32). The default level is the one given by TraceMessage::DEFAULT_LEVEL.

Implements Arcane::ITraceMng.

Definition at line 1285 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ standardOutputVerbosityLevel()

Int32 Arcane::TraceMng::standardOutputVerbosityLevel ( ) const
inlineoverridevirtual

Message verbosity level on std::cout.

Implements Arcane::ITraceMng.

Definition at line 349 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ traceId()

const String & Arcane::TraceMng::traceId ( ) const
inlineoverridevirtual

Manager identifier.

Implements Arcane::ITraceMng.

Definition at line 356 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ verbosityLevel()

Int32 Arcane::TraceMng::verbosityLevel ( ) const
inlineoverridevirtual

Message verbosity level.

Implements Arcane::ITraceMng.

Definition at line 346 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ visitClassConfigs()

void Arcane::TraceMng::visitClassConfigs ( IFunctorWithArgumentT< std::pair< String, TraceClassConfig > > * functor)
overridevirtual

\biref Applies the functor functor to all registered TraceClassConfig.

The first argument of the pair is the configuration class name and the second is its value as returned by classConfig().

It is permitted to modify the TraceClassConfig during visitation via a call to setClassConfig().

Implements Arcane::ITraceMng.

Definition at line 1263 of file arccore/src/trace/arccore/trace/TraceMng.cc.

◆ warning()

TraceMessage Arcane::TraceMng::warning ( )
inlineoverridevirtual

Stream for a warning message.

Implements Arcane::ITraceMng.

Definition at line 258 of file arccore/src/trace/arccore/trace/TraceMng.cc.

Referenced by putTrace(), and pwarning().

◆ writeDirect()

void Arcane::TraceMng::writeDirect ( const TraceMessage * msg,
const String & str )
overridevirtual

Writes a message directly.

Directly writes message msg containing string buf_array. The message is not analyzed by the instance and is always written without any specific formatting. This operation should in principle only be used by an ITraceMessageListener. For other cases, standard traces must be used.

Implements Arcane::ITraceMng.

Definition at line 1122 of file arccore/src/trace/arccore/trace/TraceMng.cc.

References Arcane::String::bytes().


The documentation for this class was generated from the following file: