Trace manager interface. More...
#include <arccore/trace/ITraceMng.h>
Public Member Functions | |
| virtual TraceMessage | error ()=0 |
| Stream for an error message. | |
| virtual TraceMessage | perror ()=0 |
| Stream for a parallel error message. | |
| virtual TraceMessage | fatal ()=0 |
| Stream for a fatal error message. | |
| virtual TraceMessage | pfatal ()=0 |
| Stream for a parallel fatal error message. | |
| virtual TraceMessage | warning ()=0 |
| Stream for a warning message. | |
| virtual TraceMessage | pwarning ()=0 |
| Stream for a parallel warning message. | |
| virtual TraceMessage | info ()=0 |
| Stream for an information message. | |
| virtual TraceMessage | pinfo ()=0 |
| Stream for a parallel information message. | |
| virtual TraceMessage | info (char category)=0 |
| Stream for an information message of a given category. | |
| virtual TraceMessage | info (Int32 level)=0 |
| Stream for an information message of a given level. | |
| virtual TraceMessage | pinfo (char category)=0 |
| Stream for a parallel information message of a given category. | |
| virtual TraceMessage | info (bool)=0 |
| Stream for a conditional information message. | |
| virtual TraceMessage | log ()=0 |
| Stream for a log message. | |
| virtual TraceMessage | plog ()=0 |
| Stream for a parallel log message. | |
| virtual TraceMessage | logdate ()=0 |
| Stream for a log message preceded by the time. | |
| virtual TraceMessageDbg | debug (Trace::eDebugLevel=Trace::Medium)=0 |
| Stream for a debug message. | |
| virtual TraceMessage | devNull ()=0 |
| Stream for an unused message. | |
| virtual ARCCORE_DEPRECATED_2018 bool | setActivated (bool v) |
| virtual bool | setInfoActivated (bool v)=0 |
| Modifies the activation state of info messages. | |
| virtual bool | isInfoActivated () const =0 |
| Indicates if info message outputs are activated. | |
| virtual void | finishInitialize ()=0 |
| Finishes initialization. | |
| virtual void | pushTraceClass (const String &name)=0 |
| Adds class s to the stack of active message classes. \threadsafe. | |
| virtual void | popTraceClass ()=0 |
| Removes the last message class from the stack. \threadsafe. | |
| virtual void | flush ()=0 |
| Flushes all streams. | |
| virtual ARCCORE_DEPRECATED_2018 void | setRedirectStream (std::ostream *o)=0 |
| Redirects all messages to the stream o. | |
| virtual void | setRedirectStream (ITraceStream *o)=0 |
| Redirects all messages to the stream o. | |
| virtual Trace::eDebugLevel | configDbgLevel () const =0 |
| Returns the dbg level of the configuration file. | |
| virtual void | addListener (ITraceMessageListener *v)=0 |
| Adds observer v to this message manager. | |
| virtual void | removeListener (ITraceMessageListener *v)=0 |
| Removes observer v from this message manager. | |
| virtual void | setTraceId (const String &id)=0 |
| Sets the manager identifier. | |
| virtual const String & | traceId () const =0 |
| Manager identifier. | |
| virtual void | setErrorFileName (const String &file_name)=0 |
| Sets the error file name to file_name. | |
| virtual void | setLogFileName (const String &file_name)=0 |
| Sets the log file name to file_name. | |
| virtual void | beginTrace (const TraceMessage *message)=0 |
| Signals the start of writing message message. | |
| virtual void | endTrace (const TraceMessage *message)=0 |
| Signals the end of writing message message. | |
| virtual void | putTrace (const String &message, int type)=0 |
| Directly sends a message of type type. | |
| virtual void | setClassConfig (const String &name, const TraceClassConfig &config)=0 |
| Sets the configuration for the message class name. | |
| virtual TraceClassConfig | classConfig (const String &name) const =0 |
| Configuration associated with the message class name. | |
| virtual void | setMaster (bool is_master)=0 |
| Sets the 'master' state of the instance. | |
| virtual bool | isMaster () const =0 |
| virtual void | setVerbosityLevel (Int32 level)=0 |
| Sets the verbosity level of the outputs. | |
| virtual Int32 | verbosityLevel () const =0 |
| Message verbosity level. | |
| virtual void | setStandardOutputVerbosityLevel (Int32 level)=0 |
| Sets the verbosity level of outputs on std::cout. | |
| virtual Int32 | standardOutputVerbosityLevel () const =0 |
| Message verbosity level on std::cout. | |
| virtual void | resetThreadStatus ()=0 |
| virtual void | writeDirect (const TraceMessage *msg, const String &str)=0 |
| Writes a message directly. | |
| virtual void | removeAllClassConfig ()=0 |
| Removes all configuration classes set via setClassConfig(). | |
| virtual void | visitClassConfigs (IFunctorWithArgumentT< std::pair< String, TraceClassConfig > > *functor)=0 |
| void | fatalMessage (const StandaloneTraceMessage &o) |
| Performs a fatal() on an already manufactured message. | |
Trace manager interface.
An instance of this class manages trace streams. To send a message, simply call the corresponding method (info() for an information message, error() for an error, ...) to retrieve a stream and use the << operator on this stream to transmit a message.
For example:
The message is sent upon destruction of the stream. In the previous examples, the streams are temporarily created (by the info() method) and destroyed as soon as the << operator has been applied to them.
If you want to send a message in several parts, you must store the returned stream:
It is possible to use simple formatters on messages (via the TraceMessage class) or standard iostream formatters by applying the operator() operator of TraceMessage.
Instances of this class are managed by a reference counter. It is preferable to keep instances in a ReferenceCounter.
Definition at line 174 of file arccore/src/trace/arccore/trace/ITraceMng.h.
|
pure virtual |
Adds observer v to this message manager.
The caller remains the owner of v and must remove it via removeListener() before destroying it.
Implemented in Arcane::TraceMng.
|
pure virtual |
Signals the start of writing message message.
Implemented in Arcane::TraceMng.
|
pure virtual |
Configuration associated with the message class name.
Implemented in Arcane::TraceMng.
|
pure virtual |
Returns the dbg level of the configuration file.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for a debug message.
Implemented in Arcane::TraceMng.
References Arcane::Trace::Medium.
Referenced by Arcane::ItemGroupImpl::changeIds(), Arcane::OutputChecker::check(), Arcane::ActiveCellGroupComputeFunctor::executeFunctor(), Arcane::ActiveFaceItemGroupComputeFunctor::executeFunctor(), Arcane::GhostItemGroupComputeFunctor::executeFunctor(), Arcane::InnerActiveFaceItemGroupComputeFunctor::executeFunctor(), Arcane::InnerFaceItemGroupComputeFunctor::executeFunctor(), Arcane::InterfaceItemGroupComputeFunctor::executeFunctor(), Arcane::ItemItemGroupComputeFunctor< ItemType >::executeFunctor(), Arcane::LevelCellGroupComputeFunctor::executeFunctor(), Arcane::OuterActiveFaceItemGroupComputeFunctor::executeFunctor(), Arcane::OuterFaceItemGroupComputeFunctor::executeFunctor(), Arcane::OwnActiveCellGroupComputeFunctor::executeFunctor(), Arcane::OwnActiveFaceItemGroupComputeFunctor::executeFunctor(), Arcane::OwnItemGroupComputeFunctor::executeFunctor(), Arcane::OwnLevelCellGroupComputeFunctor::executeFunctor(), Arcane::ItemGroupImpl::invalidate(), Arcane::ItemGroupImpl::localIdToIndex(), Arcane::ItemGroupImpl::removeSuppressedItems(), Arcane::ItemGroupImpl::setItems(), Arcane::ItemGroupImpl::synchronizer(), and Arcane::CaseOptionSimpleT< T >::updateFromFunction().
|
pure virtual |
Stream for an unused message.
Implemented in Arcane::TraceMng.
|
pure virtual |
Signals the end of writing message message.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for an error message.
Implemented in Arcane::TraceMng.
Referenced by Arcane::MeshUtils::checkMeshProperties(), Arcane::CodeService::createAndLoadCase(), Arcane::ExceptionUtils::print(), Arcane::ExceptionUtils::print(), and Arcane::ExceptionUtils::print().
|
pure virtual |
Stream for a fatal error message.
Implemented in Arcane::TraceMng.
Referenced by Arcane::ActiveCellGroupComputeFunctor::executeFunctor(), Arcane::InterfaceItemGroupComputeFunctor::executeFunctor(), Arcane::LevelCellGroupComputeFunctor::executeFunctor(), Arcane::OwnActiveCellGroupComputeFunctor::executeFunctor(), Arcane::OwnLevelCellGroupComputeFunctor::executeFunctor(), and Arcane::ItemGroupImpl::removeSuppressedItems().
| void Arcane::ITraceMng::fatalMessage | ( | const StandaloneTraceMessage & | o | ) |
Performs a fatal() on an already manufactured message.
This method allows writing code equivalent to:
like this:
This second solution allows signaling to the compiler that the method will not return and thus avoid certain compilation warnings.
Definition at line 1333 of file arccore/src/trace/arccore/trace/TraceMng.cc.
References ARCCORE_FATAL.
Referenced by visitClassConfigs().
|
pure virtual |
Finishes initialization.
Implemented in Arcane::TraceMng.
|
pure virtual |
Flushes all streams.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for an information message.
Implemented in Arcane::TraceMng.
Referenced by Arcane::dom::DOMImplementation::_load(), Arcane::CaseOptionExtended::_search(), Arcane::CaseOptionMultiExtended::_search(), Arcane::ItemGroupImpl::addItems(), Arcane::CartesianMeshAllocateBuildInfo::allocateMesh(), Arcane::UnstructuredMeshAllocateBuildInfo::allocateMesh(), Arcane::GeometricUtilities::QuadMapping::cartesianToIso(), Arcane::GeometricUtilities::QuadMapping::cartesianToIso2(), Arcane::MeshUtils::checkUniqueIdsHashCollective(), Arcane::MessagePassing::dumpDateAndMemoryUsage(), Arcane::MeshUtils::dumpSynchronizerTopologyJSON(), Arcane::MessagePassing::Mpi::MpiSerializeDispatcher::ReceiveSerializerSubRequest::executeOnCompletion(), Arcane::Parallel::Stat::mergeValues(), Arcane::Parallel::Stat::print(), Arcane::Parallel::Stat::printCollective(), Arcane::MeshUtils::printMeshGroupsMemoryUsage(), Arcane::CaseOptions::read(), Arcane::ItemGroupImpl::removeAddItems(), Arcane::Parallel::Stat::saveValues(), Arcane::Materials::ItemMaterialVariableScalar< DataType >::serialize(), Arcane::MeshUtils::writeMeshConnectivity(), and Arcane::Hdf5ItemVariableInfo< VariableType, DataType >::writeVariable().
|
pure virtual |
Stream for a conditional information message.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for an information message of a given category.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for an information message of a given level.
Implemented in Arcane::TraceMng.
|
pure virtual |
Indicates if info message outputs are activated.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for a log message.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for a log message preceded by the time.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for a parallel error message.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for a parallel fatal error message.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for a parallel information message.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for a parallel information message of a given category.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for a parallel log message.
Implemented in Arcane::TraceMng.
|
pure virtual |
Removes the last message class from the stack. \threadsafe.
Implemented in Arcane::TraceMng.
|
pure virtual |
Adds class s to the stack of active message classes. \threadsafe.
Implemented in Arcane::TraceMng.
|
pure virtual |
Directly sends a message of type type.
type must correspond to Trace::eMessageType. This method should only be used by the .NET wrapping.
Implemented in Arcane::TraceMng.
|
pure virtual |
Stream for a parallel warning message.
Implemented in Arcane::TraceMng.
Referenced by Arcane::Hdf5VariableInfoBase::writeGroup().
|
pure virtual |
Removes all configuration classes set via setClassConfig().
Implemented in Arcane::TraceMng.
|
pure virtual |
Removes observer v from this message manager.
Implemented in Arcane::TraceMng.
|
inlinevirtual |
Definition at line 220 of file arccore/src/trace/arccore/trace/ITraceMng.h.
References setInfoActivated().
|
pure virtual |
Sets the configuration for the message class name.
Implemented in Arcane::TraceMng.
|
pure virtual |
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.
Implemented in Arcane::TraceMng.
|
pure virtual |
Modifies the activation state of info messages.
Implemented in Arcane::TraceMng.
Referenced by setActivated().
|
pure virtual |
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.
Implemented in Arcane::TraceMng.
|
pure virtual |
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.
Implemented in Arcane::TraceMng.
|
pure virtual |
Redirects all messages to the stream o.
Implemented in Arcane::TraceMng.
|
pure virtual |
Redirects all messages to the stream o.
Implemented in Arcane::TraceMng.
|
pure virtual |
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.
Implemented in Arcane::TraceMng.
|
pure virtual |
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.
Implemented in Arcane::TraceMng.
|
pure virtual |
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.
Implemented in Arcane::TraceMng.
|
pure virtual |
Message verbosity level on std::cout.
Implemented in Arcane::TraceMng.
|
pure virtual |
Manager identifier.
Implemented in Arcane::TraceMng.
|
pure virtual |
Message verbosity level.
Implemented in Arcane::TraceMng.
|
pure virtual |
\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().
Implemented in Arcane::TraceMng.
References fatalMessage().
|
pure virtual |
Stream for a warning message.
Implemented in Arcane::TraceMng.
|
pure virtual |
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.
Implemented in Arcane::TraceMng.