SignalLogger
A library for signal logging.
log_messages_std.hpp File Reference
Include dependency graph for log_messages_std.hpp:

Namespaces

 message_logger
 
 message_logger::log
 

Macros

#define MELO_LOG(level, ...)
 
#define MELO_LOG_STREAM(level, message)
 
#define MELO_LOG_FP(level, ...)
 
#define MELO_LOG_STREAM_FP(level, message)
 
#define MELO_LOG_THROTTLE(rate, level, ...)
 
#define MELO_LOG_THROTTLE_STREAM(rate, level, message)
 

Detailed Description

Author
Christian Gehring
Date
Dec, 2014

Macro Definition Documentation

#define MELO_LOG (   level,
  ... 
)
Value:
{ \
switch (level) { \
{ \
std::stringstream melo_assert_stringstream; \
melo_assert_stringstream << message_logger::log::colorFatal << message_logger::common::internal::melo_string_format(__VA_ARGS__) << message_logger::log::getResetColor(); \
message_logger::common::internal::melo_throw_exception<message_logger::log::melo_fatal>("[FATAL] ", __FUNCTION__,__FILE__,__LINE__, melo_assert_stringstream.str()); \
} \
break; \
default: \
{ \
std::stringstream melo_stringstream; \
melo_stringstream << message_logger::log::getLogColor(level) << "[" << message_logger::log::getLogLevel(level) << "] " << message_logger::log::parseMemberName(__PRETTY_FUNCTION__) << message_logger::log::getLogColor(level) << message_logger::common::internal::melo_string_format(__VA_ARGS__) << message_logger::log::getResetColor(); \
std::cout << melo_stringstream.str() << std::endl; \
} \
break; \
} \
}
std::string parseMemberName(const std::string &in)
Definition: log_messages_backend.hpp:121
Definition: log_messages_backend.hpp:66
const std::string getLogColor(const message_logger::log::levels::Level &level)
Definition: log_messages_backend.hpp:85
const std::string colorFatal
Definition: log_messages_backend.hpp:77
const std::string getResetColor()
Definition: log_messages_backend.hpp:81
const std::string getLogLevel(const message_logger::log::levels::Level &level)
Definition: log_messages_backend.hpp:103
#define MELO_LOG_FP (   level,
  ... 
)
Value:
{ \
std::stringstream melo_stringstream; \
message_logger::common::internal::source_file_pos sfp(__FUNCTION__,__FILE__,__LINE__); \
melo_stringstream << message_logger::log::getLogColor(level) << "[" << message_logger::log::getLogLevel(level) << "] " << sfp.toString() << " " << message_logger::common::internal::melo_string_format(__VA_ARGS__) << message_logger::log::getResetColor(); \
std::cout << melo_stringstream.str() << std::endl; \
}
const std::string getLogColor(const message_logger::log::levels::Level &level)
Definition: log_messages_backend.hpp:85
const std::string getResetColor()
Definition: log_messages_backend.hpp:81
const std::string getLogLevel(const message_logger::log::levels::Level &level)
Definition: log_messages_backend.hpp:103
#define MELO_LOG_STREAM (   level,
  message 
)
Value:
{ \
switch (level) { \
{ \
std::stringstream melo_assert_stringstream; \
melo_assert_stringstream << message_logger::log::colorFatal << message << message_logger::log::getResetColor(); \
message_logger::common::internal::melo_throw_exception<message_logger::log::melo_fatal>("[FATAL] ", __FUNCTION__,__FILE__,__LINE__, melo_assert_stringstream.str()); \
} \
break; \
default: \
{ \
std::stringstream melo_stringstream; \
melo_stringstream << message_logger::log::getLogColor(level) << "[" << message_logger::log::getLogLevel(level) << "] " << message_logger::log::parseMemberName(__PRETTY_FUNCTION__) << message_logger::log::getLogColor(level) << message << message_logger::log::getResetColor(); \
std::cout << melo_stringstream.str() << std::endl; \
} \
break; \
} \
}
std::string parseMemberName(const std::string &in)
Definition: log_messages_backend.hpp:121
Definition: log_messages_backend.hpp:66
const std::string getLogColor(const message_logger::log::levels::Level &level)
Definition: log_messages_backend.hpp:85
const std::string colorFatal
Definition: log_messages_backend.hpp:77
const std::string getResetColor()
Definition: log_messages_backend.hpp:81
const std::string getLogLevel(const message_logger::log::levels::Level &level)
Definition: log_messages_backend.hpp:103
#define MELO_LOG_STREAM_FP (   level,
  message 
)
Value:
{ \
std::stringstream melo_stringstream; \
message_logger::common::internal::source_file_pos sfp(__FUNCTION__,__FILE__,__LINE__); \
melo_stringstream << message_logger::log::getLogColor(level) << "[" << message_logger::log::getLogLevel(level) << "] " << sfp.toString() << " " << message << message_logger::log::getResetColor(); \
std::cout << melo_stringstream.str() << std::endl; \
}
const std::string getLogColor(const message_logger::log::levels::Level &level)
Definition: log_messages_backend.hpp:85
const std::string getResetColor()
Definition: log_messages_backend.hpp:81
const std::string getLogLevel(const message_logger::log::levels::Level &level)
Definition: log_messages_backend.hpp:103
#define MELO_LOG_THROTTLE (   rate,
  level,
  ... 
)
Value:
{ \
static double last_hit = 0.0; \
if (last_hit + rate <= now.toSec()) \
{ \
last_hit = now.toSec(); \
MELO_LOG(level, __VA_ARGS__) \
} \
}
Definition: TimeStd.hpp:82
virtual double toSec() const
#define MELO_LOG(level,...)
Definition: log_messages_std.hpp:52
#define MELO_LOG_THROTTLE_STREAM (   rate,
  level,
  message 
)
Value:
{ \
static double last_hit = 0.0; \
if (last_hit + rate <= now.toSec()) \
{ \
last_hit = now.toSec(); \
MELO_LOG_STREAM(level, message) \
} \
}
#define MELO_LOG_STREAM(level, message)
Definition: log_messages_std.hpp:73
Definition: TimeStd.hpp:82
virtual double toSec() const