- if (main_config->tracereq)
- afb_hook_create_xreq(NULL, NULL, NULL, main_config->tracereq, NULL, NULL);
- if (main_config->traceapi)
- afb_hook_create_api(NULL, main_config->traceapi, NULL, NULL);
- if (main_config->traceevt)
- afb_hook_create_evt(NULL, main_config->traceevt, NULL, NULL);
- if (main_config->traceses)
- afb_hook_create_session(NULL, main_config->traceses, NULL, NULL);
+ if (tracereq)
+ afb_hook_create_xreq(NULL, NULL, NULL, afb_hook_flags_xreq_from_text(tracereq), NULL, NULL);
+#if !defined(REMOVE_LEGACY_TRACE)
+ if (traceapi || tracesvc || traceditf)
+ afb_hook_create_api(NULL, afb_hook_flags_api_from_text(traceapi)
+ | afb_hook_flags_legacy_ditf_from_text(traceditf)
+ | afb_hook_flags_legacy_svc_from_text(tracesvc), NULL, NULL);
+#else
+ if (traceapi)
+ afb_hook_create_api(NULL, afb_hook_flags_api_from_text(traceapi), NULL, NULL);
+#endif
+ if (traceevt)
+ afb_hook_create_evt(NULL, afb_hook_flags_evt_from_text(traceevt), NULL, NULL);
+ if (traceses)
+ afb_hook_create_session(NULL, afb_hook_flags_session_from_text(traceses), NULL, NULL);
+ if (traceglob)
+ afb_hook_create_global(afb_hook_flags_global_from_text(traceglob), NULL, NULL);