Defines logging macros.
More...
Go to the source code of this file.
Defines logging macros.
- Author
- Klaus Uhl uhl@f.nosp@m.zi.d.nosp@m.e
- Date
- 2007-11-17
Definition in file icl_core_logging/Logging.h.
#define DECLARE_LOG_STREAM_CLASS_DEFINITION |
( |
|
name | ) |
|
Value:name : public ::icl_core::logging::LogStream \
{ \
public: \
static ::icl_core::logging::LogStream& instance(); \
static ::icl_core::logging::LogStream *create(); \
private: \
name() \
: LogStream(#name) \
{ } \
~name() { } \
static name *m_instance; \
friend class ::icl_core::logging::LoggingManager; \
friend class ::icl_core::logging::hidden::LogStreamRegistrar; \
};
Definition at line 61 of file icl_core_logging/Logging.h.
#define DECLARE_LOG_STREAM_OPERATOR |
( |
|
object_type | ) |
|
Value: const object_type &object);
std::ostream & operator<<(std::ostream &os, StampedBase const &stamped)
Implements the actual logging for an individual thread.
Definition at line 135 of file icl_core_logging/Logging.h.
#define LOG_THREAD_STREAM |
( |
|
name | ) |
name::instance().ThreadStream() |
#define REGISTER_LOG_STREAM |
( |
|
name | ) |
|
Value:name * name::m_instance = NULL; \
{ \
if (m_instance == NULL) \
{ \
std::cout <<
"WARNING: Logging Instance is null, did you initialize the logging framework?\nYou should initialize the logging framework at the beginning of your program. This will also enable setting the log level on the command line." <<
std::endl;
\ assert(m_instance != NULL && "Tried to initialize LoggingManager but m_instance still not available."); \
return *m_instance; \
} \
else \
{ \
return *m_instance; \
} \
} \
{ \
if (m_instance == NULL) \
{ \
m_instance = new name; \
} \
return m_instance; \
} \
static LoggingManager & instance()
Implements a thread-safe logging framework.
ThreadStream & endl(ThreadStream &stream)
Definition at line 106 of file icl_core_logging/Logging.h.
#define REGISTER_LOG_STREAM_OPERATOR |
( |
|
object_type | ) |
|
Value: const object_type &object) \
{ \
std::ostringstream stream; \
stream << object; \
str << stream.str(); \
return str; \
}
std::ostream & operator<<(std::ostream &os, StampedBase const &stamped)
Implements the actual logging for an individual thread.
Definition at line 148 of file icl_core_logging/Logging.h.