Commit aa5ac85c authored by Jean-Loup Haberbusch's avatar Jean-Loup Haberbusch
Browse files

Update Log-System.md

parent 08535d14
Pipeline #21630 passed with stages
in 37 seconds
......@@ -115,6 +115,7 @@ yyyy-MM-dd HH:mm:ss.zzz [LEVEL] [DEBUG_INFO] message
```
There are four parts:
1. The first part is the time stamp of the message (at what date time exactly it is being printed). Note that you can choose to hide the time stamp if you wish.
2. The message level: it is either `ERROR`, `WARNING`, `INFO` or `TRACE`
3. The debug information: depending on your OS, compiler, and context, it generally contains the name of the class, method, and line number of the log message emitter. Note that you can choose to hide the debug information if you wish
......@@ -220,11 +221,13 @@ Every log messages can be written in a log file. The filename is determined auto
### Using CamiTK log system in static methods and in classes that do not derived from `QObject`
You need to use the specific `ALT` (alternative) log macros in the following cases:
- inside a static method
- inside a class that does not derived from `QObject`
- inside a C function (such as a `main(..)`)
If you use the normal macros and get a compilation error such as:
- `error: invalid use of ‘this’ in non-member function`
- `error: no matching function for call to ‘camitk::InterfaceLogger::log(QString, camitk::InterfaceLogger::LogLevel, const char [93], const char [84], int, NameOfANonQObjectDerivedClass*)’`
......@@ -315,6 +318,7 @@ A (legacy) MS Windows header defines `ERROR` as a preprocessor macro. This heade
included in low-level library code. This will clash with the `CAMITK_ERROR` macro.
**Hints:** if you use the `CAMITK_ERROR` or `CAMITK_ERROR_ALT` macro in your code and get these compilation errors:
- error C2589: 'constant': illegal token on right side of '::'
- error C2059: syntax error: '::'
......@@ -344,6 +348,7 @@ This will print something like:
## To go further
A lot of other things are possible with the CamiTK log system:
- log all messages to a file
- show or hide the time stamp or debugging information programmatically
- ...
......
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