6 #ifndef PUREFSM_LOGGER_HPP
7 #define PUREFSM_LOGGER_HPP
34 #if defined(__GNUC__
) || defined(__MINGW32__) || defined(__clang__
) ||
35 defined(__INTEL_COMPILER) || (defined(__ICC) && (__ICC >= 600
)) ||
36 (defined(__DMC__) && __DMC__ >= 0x810
)
39 std::string type_name() {
40 using size_type =
typename std::string::size_type;
41 char const* str =
__PRETTY_FUNCTION__;
42 while (*str !=
'=') ++str;
45 while (str[size] !=
';' && str[size] !=
']') ++size;
46 return std::string(str, size);
49 #elif defined(__MSC_VER) || defined(__FUNCSIG__)
65 "Your compiler does not support the reflection required by the logger"
76 template <std::ostream& stream>
79 stdout_logger() =
default;
82 inline void write(
const char* str) {
83 stream << str <<
logger::type_name<T>() << std::endl;
86 inline void write(
const char* str) { stream << str << std::endl; }
93 user_logger() =
delete;
110 template <
typename T>
111 inline void write(
const char* str) {
112 stream << str <<
logger::type_name<T>() << std::endl;
115 inline void write(
const char* str) { stream << str << std::endl; }