00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00022
00023 #ifndef ICL_CORE_LOGGING_LOGGING_MACROS__SLOGGING__FMT_H_INCLUDED
00024 #define ICL_CORE_LOGGING_LOGGING_MACROS__SLOGGING__FMT_H_INCLUDED
00025
00026 #define SLOGGING_FMT_LOG_FLCO(stream, level, filename, line, classname, objectname, ...) \
00027 do { \
00028 if (stream.isActive()) \
00029 { \
00030 if (stream.getLogLevel() <= level) \
00031 { \
00032 ::icl_core::logging::ThreadStream& thread_stream = stream.threadStream(level); \
00033 thread_stream.setLineLogLevel(level); \
00034 thread_stream.setFilename(filename); \
00035 thread_stream.setLine(line); \
00036 thread_stream.setClassname(classname); \
00037 thread_stream.setObjectname(objectname); \
00038 thread_stream.setFunction(__FUNCTION__); \
00039 thread_stream.printf(__VA_ARGS__); \
00040 } \
00041 } \
00042 } while (0)
00043 #define SLOGGING_FMT_LOG_CO(stream, level, classname, objectname, ...) SLOGGING_FMT_LOG_FLCO(stream, level, __FILE__, __LINE__, #classname, objectname, __VA_ARGS__)
00044 #define SLOGGING_FMT_LOG_C(stream, level, classname, ...) SLOGGING_FMT_LOG_FLCO(stream, level, __FILE__, __LINE__, #classname, "", __VA_ARGS__)
00045 #define SLOGGING_FMT_LOG(stream, level, ...) SLOGGING_FMT_LOG_FLCO(stream, level, __FILE__, __LINE__, "", "", __VA_ARGS__)
00046
00047
00048 #define SLOGGING_FMT_ERROR(stream, ...) SLOGGING_FMT_LOG(stream, ::icl_core::logging::eLL_ERROR, __VA_ARGS__)
00049 #define SLOGGING_FMT_WARNING(stream, ...) SLOGGING_FMT_LOG(stream, ::icl_core::logging::eLL_WARNING, __VA_ARGS__)
00050 #define SLOGGING_FMT_INFO(stream, ...) SLOGGING_FMT_LOG(stream, ::icl_core::logging::eLL_INFO, __VA_ARGS__)
00051 #ifdef _IC_DEBUG_
00052 # define SLOGGING_FMT_DEBUG(stream, ...) SLOGGING_FMT_LOG(stream, ::icl_core::logging::eLL_DEBUG, __VA_ARGS__)
00053 # define SLOGGING_FMT_TRACE(stream, ...) SLOGGING_FMT_LOG(stream, ::icl_core::logging::eLL_TRACE, __VA_ARGS__)
00054 #else
00055 # define SLOGGING_FMT_DEBUG(stream, ...) (void)0
00056 # define SLOGGING_FMT_TRACE(stream, ...) (void)0
00057 #endif
00058
00059
00060 #define SLOGGING_FMT_ERROR_C(stream, classname, ...) SLOGGING_FMT_LOG_C(stream, ::icl_core::logging::eLL_ERROR, classname, __VA_ARGS__)
00061 #define SLOGGING_FMT_WARNING_C(stream, classname, ...) SLOGGING_FMT_LOG_C(stream, ::icl_core::logging::eLL_WARNING, classname, __VA_ARGS__)
00062 #define SLOGGING_FMT_INFO_C(stream, classname, ...) SLOGGING_FMT_LOG_C(stream, ::icl_core::logging::eLL_INFO, classname, __VA_ARGS__)
00063 #ifdef _IC_DEBUG_
00064 # define SLOGGING_FMT_DEBUG_C(stream, classname, ...) SLOGGING_FMT_LOG_C(stream, ::icl_core::logging::eLL_DEBUG, classname, __VA_ARGS__)
00065 # define SLOGGING_FMT_TRACE_C(stream, classname, ...) SLOGGING_FMT_LOG_C(stream, ::icl_core::logging::eLL_TRACE, classname, __VA_ARGS__)
00066 #else
00067 # define SLOGGING_FMT_DEBUG_C(stream, classname, ...) (void)0
00068 # define SLOGGING_FMT_TRACE_C(stream, classname, ...) (void)0
00069 #endif
00070
00071
00072 #define SLOGGING_FMT_ERROR_CO(stream, classname, objectname, ...) SLOGGING_FMT_LOG_CO(stream, ::icl_core::logging::eLL_ERROR, classname, objectname, __VA_ARGS__)
00073 #define SLOGGING_FMT_WARNING_CO(stream, classname, objectname, ...) SLOGGING_FMT_LOG_CO(stream, ::icl_core::logging::eLL_WARNING, classname, objectname, __VA_ARGS__)
00074 #define SLOGGING_FMT_INFO_CO(stream, classname, objectname, ...) SLOGGING_FMT_LOG_CO(stream, ::icl_core::logging::eLL_INFO, classname, objectname, __VA_ARGS__)
00075 #ifdef _IC_DEBUG_
00076 # define SLOGGING_FMT_DEBUG_CO(stream, classname, objectname, ...) SLOGGING_FMT_LOG_CO(stream, ::icl_core::logging::eLL_DEBUG, classname, objectname, __VA_ARGS__)
00077 # define SLOGGING_FMT_TRACE_CO(stream, classname, objectname, ...) SLOGGING_FMT_LOG_CO(stream, ::icl_core::logging::eLL_TRACE, classname, objectname, __VA_ARGS__)
00078 #else
00079 # define SLOGGING_FMT_DEBUG_CO(stream, classname, objectname, ...) (void)0
00080 # define SLOGGING_FMT_TRACE_CO(stream, classname, objectname, ...) (void)0
00081 #endif
00082
00083 #endif