/** * @file mace/cmt/log/log.hpp * @brief Defines helpful console logging methods. */ #ifndef _BOOST_RPC_LOG_HPP_ #define _BOOST_RPC_LOG_HPP_ #include #include #include #include #ifndef __func__ #define __func__ __FUNCTION__ #endif #ifndef WIN32 #define COLOR_CONSOLE 1 #endif #include #include #include #include namespace fc { const char* thread_name(); boost::mutex& log_mutex(); namespace detail { inline std::string short_name( const std::string& file_name ) { return file_name.substr( file_name.rfind( '/' ) + 1 ); } inline void log( std::ostream& os, const char* color, const char* file, uint32_t line, const char* method, const char* text ) { fc::unique_lock lock(log_mutex()); os< inline void log( std::ostream& os, const char* color, const char* file, uint32_t line, const char* method, const std::string& format, const P1& p1 ) { fc::unique_lock lock(log_mutex()); os< inline void log( std::ostream& os, const char* color, const char* file, uint32_t line, const char* method, const std::string& format, const P1& p1, const P2& p2 ) { fc::unique_lock lock(log_mutex()); os< inline void log( std::ostream& os, const char* color, const char* file, uint32_t line, const char* method, const std::string& format, const P1& p1, const P2& p2, const P3& p3 ) { fc::unique_lock lock(log_mutex()); os< inline void log( std::ostream& os, const char* color, const char* file, uint32_t line, const char* method, const std::string& format, const P1& p1, const P2& p2, const P3& p3, const P4& p4 ) { fc::unique_lock lock(log_mutex()); os< inline void log( std::ostream& os, const char* color, const char* file, uint32_t line, const char* method, const std::string& format, const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5 ) { fc::unique_lock lock(log_mutex()); os< inline void log( std::ostream& os, const char* color, const char* file, uint32_t line, const char* method, const std::string& format, const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6 ) { fc::unique_lock lock(log_mutex()); os<