Computer Assisted Medical Intervention Tool Kit  version 5.2
Log.h File Reference
#include "CamiTKAPI.h"
#include "InterfaceLogger.h"
+ Include dependency graph for Log.h:

Go to the source code of this file.

Classes

class  camitk::Log
 This class is a log utility. More...
 

Namespaces

 camitk
 

Macros

#define CAMITK_ERROR(MSG)   CAMITK_LOG(camitk::InterfaceLogger::ERROR, MSG, this)
 Log for error verbosity (the minimum verbosity) Will always appear. More...
 
#define CAMITK_ERROR_ALT(MSG)   CAMITK_LOG_ALT(camitk::InterfaceLogger::ERROR, MSG)
 
#define CAMITK_ERROR_IF(COND, MSG)
 
#define CAMITK_ERROR_IF_ALT(COND, MSG)
 
#define CAMITK_INFO(MSG)   CAMITK_LOG(camitk::InterfaceLogger::INFO, MSG, this)
 Log for info verbosity (the second most verbose one) The msg will appear only if the user asked for INFO verbosity. More...
 
#define CAMITK_INFO_ALT(MSG)   CAMITK_LOG_ALT(camitk::InterfaceLogger::INFO, MSG)
 
#define CAMITK_INFO_IF(COND, MSG)
 
#define CAMITK_INFO_IF_ALT(COND, MSG)
 
#define CAMITK_LOG(LEVEL, MSG, SENDER)   camitk::Log::getLogger()->log(MSG, LEVEL, __FILE__, Q_FUNC_INFO, __LINE__, SENDER);
 Generic log macro (it is NOT recommended to use it directly...) More...
 
#define CAMITK_LOG_ALT(LEVEL, MSG)   camitk::Log::getLogger()->log(MSG, LEVEL, __FILE__, __func__, __LINE__);
 
#define CAMITK_PRINT_POINTER(PTR)   (QString(#PTR) + QString("->[0x%1]").arg((quintptr)PTR, QT_POINTER_SIZE * 2, 16, QChar('0')))
 Helper macro that produce a QString reprensenting a pointer. More...
 
#define CAMITK_TRACE(MSG)   CAMITK_LOG(camitk::InterfaceLogger::TRACE, MSG, this)
 Log for trace verbosity (the most verbose one, should be used for bug report) The msg will appear only if the user asked for TRACE verbosity. More...
 
#define CAMITK_TRACE_ALT(MSG)   CAMITK_LOG_ALT(camitk::InterfaceLogger::TRACE, MSG)
 
#define CAMITK_TRACE_IF(COND, MSG)
 The LOG_VERBOSITY_IF Macros are triggered only if the given condition is true. More...
 
#define CAMITK_TRACE_IF_ALT(COND, MSG)
 
#define CAMITK_WARNING(MSG)   CAMITK_LOG(camitk::InterfaceLogger::WARNING, MSG, this)
 Log for warning verbosity (the most common one) Will appear by default. More...
 
#define CAMITK_WARNING_ALT(MSG)   CAMITK_LOG_ALT(camitk::InterfaceLogger::WARNING, MSG)
 
#define CAMITK_WARNING_IF(COND, MSG)
 
#define CAMITK_WARNING_IF_ALT(COND, MSG)
 

Macro Definition Documentation

◆ CAMITK_ERROR

#define CAMITK_ERROR (   MSG)    CAMITK_LOG(camitk::InterfaceLogger::ERROR, MSG, this)

Log for error verbosity (the minimum verbosity) Will always appear.

◆ CAMITK_ERROR_ALT

#define CAMITK_ERROR_ALT (   MSG)    CAMITK_LOG_ALT(camitk::InterfaceLogger::ERROR, MSG)

◆ CAMITK_ERROR_IF

#define CAMITK_ERROR_IF (   COND,
  MSG 
)
Value:
{ \
if (((COND))) { \
CAMITK_ERROR(MSG) \
} \
}

◆ CAMITK_ERROR_IF_ALT

#define CAMITK_ERROR_IF_ALT (   COND,
  MSG 
)
Value:
{ \
if (((COND))) { \
CAMITK_ERROR_ALT(MSG) \
} \
}

◆ CAMITK_INFO

#define CAMITK_INFO (   MSG)    CAMITK_LOG(camitk::InterfaceLogger::INFO, MSG, this)

Log for info verbosity (the second most verbose one) The msg will appear only if the user asked for INFO verbosity.

◆ CAMITK_INFO_ALT

#define CAMITK_INFO_ALT (   MSG)    CAMITK_LOG_ALT(camitk::InterfaceLogger::INFO, MSG)

◆ CAMITK_INFO_IF

#define CAMITK_INFO_IF (   COND,
  MSG 
)
Value:
{ \
if (((COND))) { \
CAMITK_INFO(MSG) \
} \
}

◆ CAMITK_INFO_IF_ALT

#define CAMITK_INFO_IF_ALT (   COND,
  MSG 
)
Value:
{ \
if (((COND))) { \
CAMITK_INFO_ALT(MSG) \
} \
}

◆ CAMITK_LOG

#define CAMITK_LOG (   LEVEL,
  MSG,
  SENDER 
)    camitk::Log::getLogger()->log(MSG, LEVEL, __FILE__, Q_FUNC_INFO, __LINE__, SENDER);

Generic log macro (it is NOT recommended to use it directly...)

◆ CAMITK_LOG_ALT

#define CAMITK_LOG_ALT (   LEVEL,
  MSG 
)    camitk::Log::getLogger()->log(MSG, LEVEL, __FILE__, __func__, __LINE__);

◆ CAMITK_PRINT_POINTER

#define CAMITK_PRINT_POINTER (   PTR)    (QString(#PTR) + QString("->[0x%1]").arg((quintptr)PTR, QT_POINTER_SIZE * 2, 16, QChar('0')))

Helper macro that produce a QString reprensenting a pointer.

◆ CAMITK_TRACE

#define CAMITK_TRACE (   MSG)    CAMITK_LOG(camitk::InterfaceLogger::TRACE, MSG, this)

Log for trace verbosity (the most verbose one, should be used for bug report) The msg will appear only if the user asked for TRACE verbosity.

◆ CAMITK_TRACE_ALT

#define CAMITK_TRACE_ALT (   MSG)    CAMITK_LOG_ALT(camitk::InterfaceLogger::TRACE, MSG)

◆ CAMITK_TRACE_IF

#define CAMITK_TRACE_IF (   COND,
  MSG 
)
Value:
{ \
if (((COND))) { \
CAMITK_TRACE(MSG) \
} \
}

The LOG_VERBOSITY_IF Macros are triggered only if the given condition is true.

This allow to log only if something unexpected happens

◆ CAMITK_TRACE_IF_ALT

#define CAMITK_TRACE_IF_ALT (   COND,
  MSG 
)
Value:
{ \
if (((COND))) { \
CAMITK_TRACE_ALT(MSG) \
} \
}

◆ CAMITK_WARNING

#define CAMITK_WARNING (   MSG)    CAMITK_LOG(camitk::InterfaceLogger::WARNING, MSG, this)

Log for warning verbosity (the most common one) Will appear by default.

◆ CAMITK_WARNING_ALT

#define CAMITK_WARNING_ALT (   MSG)    CAMITK_LOG_ALT(camitk::InterfaceLogger::WARNING, MSG)

◆ CAMITK_WARNING_IF

#define CAMITK_WARNING_IF (   COND,
  MSG 
)
Value:
{ \
if (((COND))) { \
CAMITK_WARNING(MSG) \
} \
}

◆ CAMITK_WARNING_IF_ALT

#define CAMITK_WARNING_IF_ALT (   COND,
  MSG 
)
Value:
{ \
if (((COND))) { \
CAMITK_WARNING_ALT(MSG) \
} \
}