Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 5dffe143 authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

Update Log-System.md

parent 6f6cb004
Pipeline #35750 passed with stages
in 45 seconds
...@@ -336,15 +336,23 @@ Stylishly speaking, omitting the semi-column also remind the developer that the ...@@ -336,15 +336,23 @@ Stylishly speaking, omitting the semi-column also remind the developer that the
### Pretty print pointer value ### Pretty print pointer value
Sometimes it is quite handy to print the address where a pointer `myPointer` is pointing to. In order to do that you can use this specific trick to get a pretty print: Sometimes it is quite handy to print the address where a pointer `myPointer` is pointing to. In order to do that you, you can use the CamiTK helper macro `CAMITK_PRINT_POINTER`.
For instance, to print the pointer `myPointer` declared as `AnyClass*`, you can write:
```C++ ```C++
CAMITK_TRACE(QString("0x%1").arg((quintptr)myPointer, QT_POINTER_SIZE * 2, 16, QChar('0'))) CAMITK_INFO(tr("checking ") + CAMITK_PRINT_POINTER(myPointer))
``` ```
This will print something like: This will print:
``` ```
0x00005632e5fd5af0 checking myPointer=0x00005632e5fd5af0
``` ```
For your information, the macro is defined like this:
```C++
#define CAMITK_PRINT_POINTER(PTR) (QString(#PTR) + QString("=0x%1").arg((quintptr)PTR, QT_POINTER_SIZE * 2, 16, QChar('0')))
```
## To go further ## To go further
A lot of other things are possible with the CamiTK log system: A lot of other things are possible with the CamiTK log system:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment