25 #ifndef ICL_CORE_LOGGING_LOGGING_H_INCLUDED 26 #define ICL_CORE_LOGGING_LOGGING_H_INCLUDED 29 #include <boost/shared_ptr.hpp> 54 #ifdef _IC_BUILDER_DEPRECATED_STYLE_ 58 #define LOG_THREAD_STREAM(name) name::instance().ThreadStream() 60 #ifndef _IC_BUILDER_DEPRECATED_STYLE_ 61 # define DECLARE_LOG_STREAM_CLASS_DEFINITION(name) \ 62 name : public ::icl_core::logging::LogStream \ 65 static ::icl_core::logging::LogStream& instance(); \ 66 static ::icl_core::logging::LogStream *create(); \ 72 static name *m_instance; \ 73 friend class ::icl_core::logging::LoggingManager; \ 74 friend class ::icl_core::logging::hidden::LogStreamRegistrar; \ 78 # define DECLARE_LOG_STREAM_CLASS_DEFINITION(name) \ 79 name : public ::icl_core::logging::LogStream \ 82 static ::icl_core::logging::LogStream& instance(); \ 83 static ::icl_core::logging::LogStream *create(); \ 84 static ICL_CORE_VC_DEPRECATE_STYLE ::icl_core::logging::LogStream& Instance() ICL_CORE_GCC_DEPRECATE_STYLE; \ 85 static ICL_CORE_VC_DEPRECATE_STYLE ::icl_core::logging::LogStream *Create() ICL_CORE_GCC_DEPRECATE_STYLE; \ 91 static name *m_instance; \ 92 friend class ::icl_core::logging::LoggingManager; \ 93 friend class ::icl_core::logging::hidden::LogStreamRegistrar; \ 95 inline ::icl_core::logging::LogStream& name::Instance() \ 96 { return instance(); } \ 97 inline ::icl_core::logging::LogStream *name::Create() \ 101 #define DECLARE_LOG_STREAM(name) class DECLARE_LOG_STREAM_CLASS_DEFINITION(name) 102 #define DECLARE_LOG_STREAM_IMPORT_EXPORT(name, decl) class decl DECLARE_LOG_STREAM_CLASS_DEFINITION(name) 106 #define REGISTER_LOG_STREAM(name) \ 107 name * name::m_instance = NULL; \ 108 ::icl_core::logging::LogStream& name::instance() \ 110 if (m_instance == NULL) \ 112 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; \ 113 ::icl_core::logging::LoggingManager::instance().initialize(); \ 114 assert(m_instance != NULL && "Tried to initialize LoggingManager but m_instance still not available."); \ 115 return *m_instance; \ 119 return *m_instance; \ 122 ::icl_core::logging::LogStream * name::create() \ 124 if (m_instance == NULL) \ 126 m_instance = new name; \ 130 ::icl_core::logging::hidden::LogStreamRegistrar registrar##name(#name, &name::create); 132 #define REGISTER_LOG_OUTPUT_STREAM(name, factory) \ 133 ::icl_core::logging::hidden::LogOutputStreamRegistrar registrar##name(#name, factory); 135 #define DECLARE_LOG_STREAM_OPERATOR(object_type) \ 136 ::icl_core::logging::ThreadStream & operator << (::icl_core::logging::ThreadStream &str, \ 137 const object_type &object); 140 #define REGISTER_LOG_STREAM_OPERATOR(object_type) \ 141 ::icl_core::logging::ThreadStream & operator << (::icl_core::logging::ThreadStream &str, \ 142 const object_type &object) \ 144 str << "std::ostream redirection is not available in LXRT"; \ 147 #else // _SYSTEM_LXRT_ 148 #define REGISTER_LOG_STREAM_OPERATOR(object_type) \ 149 ::icl_core::logging::ThreadStream & operator << (::icl_core::logging::ThreadStream &str, \ 150 const object_type &object) \ 152 std::ostringstream stream; \ 154 str << stream.str(); \ 157 #endif // _SYSTEM_LXRT_ 208 #ifdef _IC_BUILDER_DEPRECATED_STYLE_ 214 Initialize(
int& argc,
char *argv[],
bool remove_read_arguments)
all options have to be registered
Represents absolute times.
Contains icl_logging::tLoggingManager.
bool initialize(int &argc, char *argv[], bool remove_read_arguments)
#define ICL_CORE_VC_DEPRECATE_STYLE
Contains icl_logging::ThreadStream.
Contains icl_logging::LoggingManager.
Defines SLOGGING logging macros.
Contains macros to deprecate classes, types, functions and variables.
Contains import/export definitions for the Win32 plattform.
Defines LLOGGING logging macros.
boost::shared_ptr< LifeCycle > autoStart(int &argc, char *argv[])
ICL_CORE_VC_DEPRECATE_STYLE bool Initialize(int &argc, char *argv[], bool remove_read_arguments) ICL_CORE_GCC_DEPRECATE_STYLE
ParameterRegistrationCheck
Contains constants used in icl_core::logging.
Defines MLOGGING logging macros.
void setLogLevel(icl_core::logging::LogLevel log_level)
Set a global log level for all streams.
command line options are left untouched
#define DECLARE_LOG_STREAM_IMPORT_EXPORT(name, decl)
Repesents absolute times.
ThreadStream & operator<<(ThreadStream &stream, const icl_core::TimeStamp &time_stamp)
Contains icl_logging::LogStream.
#define ICL_CORE_LOGGING_IMPORT_EXPORT
#define ICL_CORE_GCC_DEPRECATE_STYLE