SOFA API  59c939c2
Open source framework for multi-physics simuation
sofa::helper::logging::Message Class Reference

#include <Message.h>

Detailed Description

A message is the core object of the msg_* API. A message contains a textual description provided by the user as well as the location in source file (or in a separated file) from where the message have been emitted. A message also contains a ComponentInfo which can be used to provide additional details about the emitter's context.

Static Public Attributes

static TypeSet AnyTypes
 
static Message emptyMsg
 

Protected Attributes

ComponentInfo::SPtr m_componentinfo
 
FileInfo::SPtr m_fileInfo
 a trace (name, path) from whom has emitted this message. More...
 
std::stringstream m_stream
 the actual message More...
 
Class m_class
 who is the attender of the message (developers or users)? More...
 
Type m_type
 the message level More...
 
int m_id
 should it be stored here or in the handler that needs it? More...
 

Public Member Functions

 Message ()
 
 Message (const Message &msg)
 
 Message (Class mclass, Type type, const ComponentInfo::SPtr &=ComponentInfo::SPtr(), const FileInfo::SPtr &fileInfo=EmptyFileInfo)
 
Messageoperator= (const Message &msg)
 
const FileInfo::SPtrfileInfo () const
 
const ComponentInfo::SPtrcomponentInfo () const
 
const std::stringstream & message () const
 
Class context () const
 
Type type () const
 
const std::string & sender () const
 
const std::string messageAsString () const
 
bool empty () const
 
template<class T >
Messageoperator<< (const T &x)
 
template<>
SOFA_HELPER_API Messageoperator<< (const FileInfo::SPtr &fi)
 

Attribute details

Message::TypeSet sofa::helper::logging::Message::AnyTypes
static
Initial value:
= {Type::Info,Type::Advice,Type::Deprecated,
Type::Warning,Type::Error,Type::Fatal}
Message sofa::helper::logging::Message::emptyMsg
static
Class sofa::helper::logging::Message::m_class
protected

who is the attender of the message (developers or users)?

ComponentInfo::SPtr sofa::helper::logging::Message::m_componentinfo
protected
FileInfo::SPtr sofa::helper::logging::Message::m_fileInfo
protected

a trace (name, path) from whom has emitted this message.

a trace (file,line) from where the message have been created

int sofa::helper::logging::Message::m_id
protected

should it be stored here or in the handler that needs it?

std::stringstream sofa::helper::logging::Message::m_stream
protected

the actual message

Type sofa::helper::logging::Message::m_type
protected

the message level

Constructor details

sofa::helper::logging::Message::Message ( )
inline
sofa::helper::logging::Message::Message ( const Message msg)
sofa::helper::logging::Message::Message ( Class  mclass,
Type  type,
const ComponentInfo::SPtr componentInfo = ComponentInfo::SPtr(),
const FileInfo::SPtr fileInfo = EmptyFileInfo 
)

Function details

const ComponentInfo::SPtr& sofa::helper::logging::Message::componentInfo ( ) const
inline
Class sofa::helper::logging::Message::context ( ) const
inline
bool sofa::helper::logging::Message::empty ( ) const
const FileInfo::SPtr& sofa::helper::logging::Message::fileInfo ( ) const
inline
const std::stringstream& sofa::helper::logging::Message::message ( ) const
inline
const std::string sofa::helper::logging::Message::messageAsString ( ) const
inline
template<class T >
Message& sofa::helper::logging::Message::operator<< ( const T &  x)
inline
SOFA_HELPER_API Message & sofa::helper::logging::Message::operator<< ( const FileInfo::SPtr fi)
Message & sofa::helper::logging::Message::operator= ( const Message msg)
const std::string& sofa::helper::logging::Message::sender ( ) const
inline
Type sofa::helper::logging::Message::type ( ) const
inline

Enum details

class of messages

Enumerator
Dev 
Runtime 
Log 
CEmpty 
ClassCount 

possible levels of messages (ordered)

Enumerator
Info 
Advice 
Deprecated 
Warning 
Error 
Fatal 
TEmpty 
TypeCount