07e1a4a2a3dd9cfd4a03ce4b64d7ace9f6b79ffa
[AGL/documentation.git] / docs / 4_APIs_and_Services / 4.3_Application_Framework_Binder / 3_Binder_references / 2_Macros_for-logging.md
1 ---
2 edit_link: ''
3 title: Macros for logging
4 origin_url: >-
5   https://git.automotivelinux.org/src/app-framework-binder/plain/docs/reference-v3/macro-log.md?h=master
6 ---
7
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/app-framework-binder-developer-guides-api-services-book.yml -->
9
10 Macro for logging
11 =================
12
13 The final behaviour of macros can be tuned using 2 defines that must be defined
14 before including **<afb/afb-binding.h>**.
15
16 | define                                | action
17 |---------------------------------------|--------------------
18 | AFB_BINDING_PRAGMA_NO_VERBOSE_DATA    | show file and line, remove function and text message
19 | AFB_BINDING_PRAGMA_NO_VERBOSE_DETAILS | show text, remove function, line and file
20
21 ## Logging for an api
22
23 The following macros must be used for logging for an **api** of type
24 **afb_api_t**.
25
26 ```C
27 AFB_API_ERROR(api,fmt,...)
28 AFB_API_WARNING(api,fmt,...)
29 AFB_API_NOTICE(api,fmt,...)
30 AFB_API_INFO(api,fmt,...)
31 AFB_API_DEBUG(api,fmt,...)
32 ```
33
34 ## Logging for a request
35
36
37 The following macros can be used for logging in the context
38 of a request **req** of type **afb_req_t**:
39
40 ```C
41 AFB_REQ_ERROR(req,fmt,...)
42 AFB_REQ_WARNING(req,fmt,...)
43 AFB_REQ_NOTICE(req,fmt,...)
44 AFB_REQ_INFO(req,fmt,...)
45 AFB_REQ_DEBUG(req,fmt,...)
46 ```
47
48 By default, the logging macros add file, line and function
49 indication.
50
51 ## Logging legacy
52
53 The following macros are provided for legacy.
54
55 ```C
56 AFB_ERROR(fmt,...)
57 AFB_WARNING(fmt,...)
58 AFB_NOTICE(fmt,...)
59 AFB_INFO(fmt,...)
60 AFB_DEBUG(fmt,...)
61 ```
62