fw4spl
fwLog::Logger Class Reference

Logger class used to store logs. More...

#include <Logger.hpp>

+ Inheritance diagram for fwLog::Logger:
+ Collaboration diagram for fwLog::Logger:

Public Types

typedef std::vector< ::fwLog::LogLogContainerType
 
typedef LogContainerType::iterator IteratorType
 
typedef LogContainerType::const_iterator ConstIteratorType
 
typedef LogContainerType::reverse_iterator ReverseIteratorType
 
typedef LogContainerType::const_reverse_iterator ConstReverseIteratorType
 

Public Member Functions

virtual bool isA (const std::string &type) const override
 
FWLOG_API Logger ()
 Constructor.
 
FWLOG_API ~Logger ()
 Destructor.
 
FWLOG_API void information (const std::string &message)
 Add information log into the logger. More...
 
FWLOG_API void warning (const std::string &message)
 Add warning log into the logger. More...
 
FWLOG_API void critical (const std::string &message)
 Add critical log into the logger. More...
 
FWLOG_API::fwLog::Log getLog (unsigned int index)
 Return the log matching the specified index. More...
 
FWLOG_API std::size_t count () const
 Returns the number of logs.
 
FWLOG_API std::size_t count (::fwLog::Log::LevelType level) const
 Return the number of logs matching the specified level. More...
 
FWLOG_API void sort ()
 Sort logs according to log levels.
 
FWLOG_API void clear ()
 Clear logs.
 
bool empty () const
 Return whether the logger contains logs or not.
 
IteratorType begin ()
 
IteratorType end ()
 
ConstIteratorType begin () const
 
ConstIteratorType end () const
 
ReverseIteratorType rbegin ()
 
ReverseIteratorType rend ()
 
ConstReverseIteratorType rbegin () const
 
ConstReverseIteratorType rend () const
 
- Public Member Functions inherited from fwTools::Object
- Public Member Functions inherited from fwCore::BaseObject

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
- Static Public Member Functions inherited from fwTools::Object
static bool isTypeOf (const std::string &type)
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
- Static Public Member Functions inherited from fwCore::BaseObject
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Static Protected Member Functions

static bool logSorter (const ::fwLog::Log &logA, const ::fwLog::Log &logB)
 Function used to sort logs. More...
 
- Static Protected Member Functions inherited from fwTools::fwID
static bool isTypeOf (const std::string &type)
 
static FWTOOLS_API bool exist (IDType _id)
 
static FWTOOLS_API std::shared_ptr< ::fwTools::ObjectgetObject (IDType requestID)
 Retrieve the object attached to the given id. Return a null sptr if no correspondence exist. More...
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Protected Attributes

LogContainerType m_logContainer
 Log container.
 
- Protected Attributes inherited from fwTools::Object
std::shared_ptr< ::fwTools::UUIDm_uuid
 UUID used to identify the object, notably for serialization.
 

Friends

template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Demangling methods

virtual const std::string & getLeafClassname () const override
 return object's classname without its namespace, i.e. BaseObject
 
virtual const std::string & getClassname () const override
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Additional Inherited Members

- Protected Types inherited from fwTools::fwID
enum  Policy { EMPTY = 1, GENERATE, MUST_EXIST }
 
typedef std::string IDType
 
- Protected Member Functions inherited from fwTools::fwID
FWTOOLS_API bool hasID () const
 Return true if the object has an id set. More...
 
FWTOOLS_API IDType getID (Policy policy=GENERATE) const
 Returns the id of the object. If it is not set and the policy value is. More...
 
virtual FWTOOLS_API void setID (IDType newID)
 Set a newID for the object, (newID must not exist in fwID), the oldest one is released. More...
 
FWTOOLS_API void resetID ()
 Release the id for the object. More...
 
 fwID ()
 Constructor : does nothing.
 

Detailed Description

Logger class used to store logs.

Definition at line 23 of file fwLog/include/fwLog/Logger.hpp.

Member Function Documentation

std::size_t fwLog::Logger::count ( ::fwLog::Log::LevelType  level) const

Return the number of logs matching the specified level.

Parameters
[in]levelLog level

Definition at line 68 of file fwLog/src/fwLog/Logger.cpp.

References count(), and m_logContainer.

+ Here is the call graph for this function:

void fwLog::Logger::critical ( const std::string &  message)

Add critical log into the logger.

Parameters
[in]messageLog message

Definition at line 44 of file fwLog/src/fwLog/Logger.cpp.

References m_logContainer, and SLM_ERROR.

fwLog::Log fwLog::Logger::getLog ( unsigned int  index)

Return the log matching the specified index.

Parameters
[in]indexLog's index

Definition at line 53 of file fwLog/src/fwLog/Logger.cpp.

References count(), m_logContainer, and SLM_ASSERT.

+ Here is the call graph for this function:

void fwLog::Logger::information ( const std::string &  message)

Add information log into the logger.

Parameters
[in]messageLog message

Definition at line 26 of file fwLog/src/fwLog/Logger.cpp.

References m_logContainer, and SLM_INFO.

bool fwLog::Logger::logSorter ( const ::fwLog::Log logA,
const ::fwLog::Log logB 
)
staticprotected

Function used to sort logs.

Parameters
logAFirst log
logBSecond log

Definition at line 97 of file fwLog/src/fwLog/Logger.cpp.

Referenced by sort().

+ Here is the caller graph for this function:

void fwLog::Logger::warning ( const std::string &  message)

Add warning log into the logger.

Parameters
[in]messageLog message

Definition at line 35 of file fwLog/src/fwLog/Logger.cpp.

References m_logContainer, and SLM_WARN.


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