23 #ifndef ICL_CORE_LOGGING_SCOPED_TIMER_H_INCLUDED 24 #define ICL_CORE_LOGGING_SCOPED_TIMER_H_INCLUDED 26 #include <boost/preprocessor/cat.hpp> 43 template <
typename TStreamName>
66 const std::string& filename = __FILE__,
67 const std::size_t line = __LINE__,
68 const std::string& classname =
"",
69 const std::string& objectname =
"")
90 void print(
const std::string& extra_description)
const 135 #define LOGGING_SCOPED_TIMER_VFLCO(streamname, varname, description, level, filename, line, classname, objectname) \ 136 ::icl_core::logging::ScopedTimer<streamname> varname(description, level, filename, line, classname, objectname) 137 #define LOGGING_SCOPED_TIMER_VCO(streamname, varname, description, level, classname, objectname) \ 138 LOGGING_SCOPED_TIMER_VFLCO(streamname, varname, description, level, __FILE__, __LINE__, classname, objectname) 139 #define LOGGING_SCOPED_TIMER_VC(streamname, varname, description, level, classname) \ 140 LOGGING_SCOPED_TIMER_VFLCO(streamname, varname, description, level, __FILE__, __LINE__, classname, "") 141 #define LOGGING_SCOPED_TIMER_V(streamname, varname, description, level) \ 142 LOGGING_SCOPED_TIMER_VFLCO(streamname, varname, description, level, __FILE__, __LINE__, "", "") 144 #define LOGGING_SCOPED_TIMER_FLCO(streamname, description, level, filename, line, classname, objectname) \ 145 LOGGING_SCOPED_TIMER_VFLCO(streamname, BOOST_PP_CAT(scoped_timer_, line), description, level, filename, line, classname, objectname) 146 #define LOGGING_SCOPED_TIMER_CO(streamname, description, level, classname, objectname) \ 147 LOGGING_SCOPED_TIMER_FLCO(streamname, description, level, __FILE__, __LINE__, classname, objectname) 148 #define LOGGING_SCOPED_TIMER_C(streamname, description, level, classname) \ 149 LOGGING_SCOPED_TIMER_FLCO(streamname, description, level, __FILE__, __LINE__, classname, "") 150 #define LOGGING_SCOPED_TIMER(streamname, description, level) \ 151 LOGGING_SCOPED_TIMER_FLCO(streamname, description, level, __FILE__, __LINE__, "", "") 153 #define LOGGING_SCOPED_TIMER_ERROR(streamname, description) LOGGING_SCOPED_TIMER(streamname, description, ::icl_core::logging::eLL_ERROR) 154 #define LOGGING_SCOPED_TIMER_WARNING(streamname, description) LOGGING_SCOPED_TIMER(streamname, description, ::icl_core::logging::eLL_WARNING) 155 #define LOGGING_SCOPED_TIMER_INFO(streamname, description) LOGGING_SCOPED_TIMER(streamname, description, ::icl_core::logging::eLL_INFO) 157 # define LOGGING_SCOPED_TIMER_DEBUG(streamname, description) LOGGING_SCOPED_TIMER(streamname, description, ::icl_core::logging::eLL_DEBUG) 158 # define LOGGING_SCOPED_TIMER_TRACE(streamname, description) LOGGING_SCOPED_TIMER(streamname, description, ::icl_core::logging::eLL_TRACE) 160 # define LOGGING_SCOPED_TIMER_DEBUG(streamname, description) (void)0 161 # define LOGGING_SCOPED_TIMER_TRACE(streamname, description) (void)0 164 #define LOGGING_SCOPED_TIMER_ERROR_C(streamname, description, classname) LOGGING_SCOPED_TIMER_C(streamname, description, ::icl_core::logging::eLL_ERROR, classname) 165 #define LOGGING_SCOPED_TIMER_WARNING_C(streamname, description, classname) LOGGING_SCOPED_TIMER_C(streamname, description, ::icl_core::logging::eLL_WARNING, classname) 166 #define LOGGING_SCOPED_TIMER_INFO_C(streamname, description, classname) LOGGING_SCOPED_TIMER_C(streamname, description, ::icl_core::logging::eLL_INFO, classname) 168 # define LOGGING_SCOPED_TIMER_DEBUG_C(streamname, description, classname) LOGGING_SCOPED_TIMER_C(streamname, description, ::icl_core::logging::eLL_DEBUG, classname) 169 # define LOGGING_SCOPED_TIMER_TRACE_C(streamname, description, classname) LOGGING_SCOPED_TIMER_C(streamname, description, ::icl_core::logging::eLL_TRACE, classname) 171 # define LOGGING_SCOPED_TIMER_DEBUG_C(streamname, description, classname) (void)0 172 # define LOGGING_SCOPED_TIMER_TRACE_C(streamname, description, classname) (void)0 175 #define LOGGING_SCOPED_TIMER_ERROR_CO(streamname, description, classname, objectname) LOGGING_SCOPED_TIMER_CO(streamname, description, ::icl_core::logging::eLL_ERROR, classname, objectname) 176 #define LOGGING_SCOPED_TIMER_WARNING_CO(streamname, description, classname, objectname) LOGGING_SCOPED_TIMER_CO(streamname, description, ::icl_core::logging::eLL_WARNING, classname, objectname) 177 #define LOGGING_SCOPED_TIMER_INFO_CO(streamname, description, classname, objectname) LOGGING_SCOPED_TIMER_CO(streamname, description, ::icl_core::logging::eLL_INFO, classname, objectname) 179 # define LOGGING_SCOPED_TIMER_DEBUG_CO(streamname, description, classname, objectname) LOGGING_SCOPED_TIMER_CO(streamname, description, ::icl_core::logging::eLL_DEBUG, classname, objectname) 180 # define LOGGING_SCOPED_TIMER_TRACE_CO(streamname, description, classname, objectname) LOGGING_SCOPED_TIMER_CO(streamname, description, ::icl_core::logging::eLL_TRACE, classname, objectname) 182 # define LOGGING_SCOPED_TIMER_DEBUG_CO(streamname, description, classname, objectname) (void)0 183 # define LOGGING_SCOPED_TIMER_TRACE_CO(streamname, description, classname, objectname) (void)0 186 #define LOGGING_SCOPED_TIMER_ERROR_V(streamname, varname, description) LOGGING_SCOPED_TIMER_V(streamname, varname, description, ::icl_core::logging::eLL_ERROR) 187 #define LOGGING_SCOPED_TIMER_WARNING_V(streamname, varname, description) LOGGING_SCOPED_TIMER_V(streamname, varname, description, ::icl_core::logging::eLL_WARNING) 188 #define LOGGING_SCOPED_TIMER_INFO_V(streamname, varname, description) LOGGING_SCOPED_TIMER_V(streamname, varname, description, ::icl_core::logging::eLL_INFO) 190 # define LOGGING_SCOPED_TIMER_DEBUG_V(streamname, varname, description) LOGGING_SCOPED_TIMER_V(streamname, varname, description, ::icl_core::logging::eLL_DEBUG) 191 # define LOGGING_SCOPED_TIMER_TRACE_V(streamname, varname, description) LOGGING_SCOPED_TIMER_V(streamname, varname, description, ::icl_core::logging::eLL_TRACE) 193 # define LOGGING_SCOPED_TIMER_DEBUG_V(streamname, varname, description) (void)0 194 # define LOGGING_SCOPED_TIMER_TRACE_V(streamname, varname, description) (void)0 197 #define LOGGING_SCOPED_TIMER_ERROR_VC(streamname, varname, description, classname) LOGGING_SCOPED_TIMER_VC(streamname, varname, description, ::icl_core::logging::eLL_ERROR, classname) 198 #define LOGGING_SCOPED_TIMER_WARNING_VC(streamname, varname, description, classname) LOGGING_SCOPED_TIMER_VC(streamname, varname, description, ::icl_core::logging::eLL_WARNING, classname) 199 #define LOGGING_SCOPED_TIMER_INFO_VC(streamname, varname, description, classname) LOGGING_SCOPED_TIMER_VC(streamname, varname, description, ::icl_core::logging::eLL_INFO, classname) 201 # define LOGGING_SCOPED_TIMER_DEBUG_VC(streamname, varname, description, classname) LOGGING_SCOPED_TIMER_VC(streamname, varname, description, ::icl_core::logging::eLL_DEBUG, classname) 202 # define LOGGING_SCOPED_TIMER_TRACE_VC(streamname, varname, description, classname) LOGGING_SCOPED_TIMER_VC(streamname, varname, description, ::icl_core::logging::eLL_TRACE, classname) 204 # define LOGGING_SCOPED_TIMER_DEBUG_VC(streamname, varname, description, classname) (void)0 205 # define LOGGING_SCOPED_TIMER_TRACE_VC(streamname, varname, description, classname) (void)0 208 #define LOGGING_SCOPED_TIMER_ERROR_VCO(streamname, varname, description, classname, objectname) LOGGING_SCOPED_TIMER_VCO(streamname, varname, description, ::icl_core::logging::eLL_ERROR, classname, objectname) 209 #define LOGGING_SCOPED_TIMER_WARNING_VCO(streamname, varname, description, classname, objectname) LOGGING_SCOPED_TIMER_VCO(streamname, varname, description, ::icl_core::logging::eLL_WARNING, classname, objectname) 210 #define LOGGING_SCOPED_TIMER_INFO_VCO(streamname, varname, description, classname, objectname) LOGGING_SCOPED_TIMER_VCO(streamname, varname, description, ::icl_core::logging::eLL_INFO, classname, objectname) 212 # define LOGGING_SCOPED_TIMER_DEBUG_VCO(streamname, varname, description, classname, objectname) LOGGING_SCOPED_TIMER_VCO(streamname, varname, description, ::icl_core::logging::eLL_DEBUG, classname, objectname) 213 # define LOGGING_SCOPED_TIMER_TRACE_VCO(streamname, varname, description, classname, objectname) LOGGING_SCOPED_TIMER_VCO(streamname, varname, description, ::icl_core::logging::eLL_TRACE, classname, objectname) 215 # define LOGGING_SCOPED_TIMER_DEBUG_VCO(streamname, varname, description, classname, objectname) (void)0 216 # define LOGGING_SCOPED_TIMER_TRACE_VCO(streamname, varname, description, classname, objectname) (void)0 Represents absolute times.
void print(const std::string &extra_description) const
Outputs the time passed since construction.
ScopedTimer(const std::string &description="ScopedTimer", const LogLevel level=eLL_DEBUG, const std::string &filename=__FILE__, const std::size_t line=__LINE__, const std::string &classname="", const std::string &objectname="")
Contains icl_logging::ThreadStream.
Defines SLOGGING logging macros.
const std::string m_objectname
const TimeStamp m_start_time
Implements a thread-safe logging framework.
ThreadStream & endl(ThreadStream &stream)
Contains icl_logging::LogLevel.
const std::string m_filename
const std::string m_description
Contains icl_logging::LogStream.
void print() const
Outputs the time passed since construction.
#define SLOGGING_LOG_FLCO(stream, level, filename, line, classname, objectname, arg)
const std::string m_classname