log.h: define G_LOG_DOMAIN only if WP_USE_LOCAL_LOG_TOPIC_IN_G_LOG is defined
Define WP_USE_LOCAL_LOG_TOPIC_IN_G_LOG in project scope, so that we always use this feature in our codebase without causing problems for other projects. Fixes #571
This commit is contained in:
@@ -59,10 +59,12 @@ struct _WpLogTopic {
|
|||||||
WP_LOG_TOPIC_STATIC(WP_LOCAL_LOG_TOPIC, t)
|
WP_LOG_TOPIC_STATIC(WP_LOCAL_LOG_TOPIC, t)
|
||||||
|
|
||||||
/* make glib log functions also use the local log topic */
|
/* make glib log functions also use the local log topic */
|
||||||
#ifdef G_LOG_DOMAIN
|
#ifdef WP_USE_LOCAL_LOG_TOPIC_IN_G_LOG
|
||||||
# undef G_LOG_DOMAIN
|
# ifdef G_LOG_DOMAIN
|
||||||
|
# undef G_LOG_DOMAIN
|
||||||
|
# endif
|
||||||
|
# define G_LOG_DOMAIN (WP_LOCAL_LOG_TOPIC->topic_name)
|
||||||
#endif
|
#endif
|
||||||
#define G_LOG_DOMAIN (WP_LOCAL_LOG_TOPIC->topic_name)
|
|
||||||
|
|
||||||
WP_API
|
WP_API
|
||||||
void wp_log_topic_init (WpLogTopic *topic);
|
void wp_log_topic_init (WpLogTopic *topic);
|
||||||
|
@@ -137,6 +137,7 @@ add_project_arguments(cc.get_supported_arguments(common_flags), language: 'c')
|
|||||||
common_args = [
|
common_args = [
|
||||||
'-D_GNU_SOURCE',
|
'-D_GNU_SOURCE',
|
||||||
'-DG_LOG_USE_STRUCTURED',
|
'-DG_LOG_USE_STRUCTURED',
|
||||||
|
'-DWP_USE_LOCAL_LOG_TOPIC_IN_G_LOG',
|
||||||
]
|
]
|
||||||
add_project_arguments(common_args, language: 'c')
|
add_project_arguments(common_args, language: 'c')
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user