Improve documentation of api v3
[src/app-framework-binder.git] / docs / reference-v3 / macro-log.md
1 Macro for logging
2 =================
3
4 The final behaviour of macros can be tuned using 2 defines that must be defined
5 before including **<afb/afb-binding.h>**.
6
7 | define                                | action
8 |---------------------------------------|--------------------
9 | AFB_BINDING_PRAGMA_NO_VERBOSE_DATA    | show file and line, remove function and text message
10 | AFB_BINDING_PRAGMA_NO_VERBOSE_DETAILS | show text, remove function, line and file
11
12 ## Logging for an api
13
14 The following macros must be used for logging for an **api** of type
15 **afb_api_t**.
16
17 ```C
18 AFB_API_ERROR(api,fmt,...)
19 AFB_API_WARNING(api,fmt,...)
20 AFB_API_NOTICE(api,fmt,...)
21 AFB_API_INFO(api,fmt,...)
22 AFB_API_DEBUG(api,fmt,...)
23 ```
24
25 ## Logging for a request
26
27
28 The following macros can be used for logging in the context
29 of a request **req** of type **afb_req_t**:
30
31 ```C
32 AFB_REQ_ERROR(req,fmt,...)
33 AFB_REQ_WARNING(req,fmt,...)
34 AFB_REQ_NOTICE(req,fmt,...)
35 AFB_REQ_INFO(req,fmt,...)
36 AFB_REQ_DEBUG(req,fmt,...)
37 ```
38
39 By default, the logging macros add file, line and function
40 indication.
41
42 ## Logging legacy
43
44 The following macros are provided for legacy.
45
46 ```C
47 AFB_ERROR(fmt,...)
48 AFB_WARNING(fmt,...)
49 AFB_NOTICE(fmt,...)
50 AFB_INFO(fmt,...)
51 AFB_DEBUG(fmt,...)
52 ```
53