SOFA API  1c8b807d
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

◆ AnyTypes

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

◆ emptyMsg

Message sofa::helper::logging::Message::emptyMsg
static

◆ m_class

Class sofa::helper::logging::Message::m_class
protected

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

◆ m_componentinfo

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

◆ m_fileInfo

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

◆ m_id

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

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

◆ m_stream

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

the actual message

◆ m_type

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

the message level

Constructor details

◆ Message() [1/3]

sofa::helper::logging::Message::Message ( )
inline

◆ Message() [2/3]

sofa::helper::logging::Message::Message ( const Message msg)

◆ Message() [3/3]

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

Function details

◆ componentInfo()

const ComponentInfo::SPtr& sofa::helper::logging::Message::componentInfo ( ) const
inline

◆ context()

Class sofa::helper::logging::Message::context ( ) const
inline

◆ empty()

bool sofa::helper::logging::Message::empty ( ) const

◆ fileInfo()

const FileInfo::SPtr& sofa::helper::logging::Message::fileInfo ( ) const
inline

◆ message()

const std::stringstream& sofa::helper::logging::Message::message ( ) const
inline

◆ messageAsString()

const std::string sofa::helper::logging::Message::messageAsString ( ) const
inline

◆ operator<<() [1/2]

template<>
SOFA_HELPER_API Message & sofa::helper::logging::Message::operator<< ( const FileInfo::SPtr fi)

◆ operator<<() [2/2]

template<class T >
Message& sofa::helper::logging::Message::operator<< ( const T &  x)
inline

◆ operator=()

Message & sofa::helper::logging::Message::operator= ( const Message msg)

◆ sender()

const std::string& sofa::helper::logging::Message::sender ( ) const
inline

◆ type()

Type sofa::helper::logging::Message::type ( ) const
inline

Enum details

◆ Class

class of messages

Enumerator
Dev 
Runtime 
Log 
CEmpty 
ClassCount 

◆ Type

possible levels of messages (ordered)

Enumerator
Info 
Advice 
Deprecated 
Warning 
Error 
Fatal 
TEmpty 
TypeCount