From 1c707ea147d40ff2119b430512fe4e45c564ce32 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 10 Aug 2012 16:35:40 +0200 Subject: Support disabling discovery for the LD_PRELOAD variant When compiled with --disable-discovery, the LD_PRELOAD variant will have automatic field discovery disabled. This does not affect the linkable library, which always has them enabled by default. Signed-off-by: Gergely Nagy --- lib/umberlog.c | 8 +++++++- lib/umberlog.rst | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/umberlog.c b/lib/umberlog.c index be0b9d6..b64d715 100644 --- a/lib/umberlog.c +++ b/lib/umberlog.c @@ -77,7 +77,13 @@ static struct char hostname[_POSIX_HOST_NAME_MAX + 1]; } ul_process_data = { - PTHREAD_MUTEX_INITIALIZER, 0, LOG_USER, NULL, + PTHREAD_MUTEX_INITIALIZER, +#if __UL_PRELOAD__ + DEFAULT_DISCOVER_FLAGS, +#else + LOG_UL_ALL, +#endif + LOG_USER, NULL, -1, (uid_t)-1, (gid_t)-1, { 0, } }; diff --git a/lib/umberlog.rst b/lib/umberlog.rst index 5ae5c7c..7c3af99 100644 --- a/lib/umberlog.rst +++ b/lib/umberlog.rst @@ -125,7 +125,8 @@ flags: LOG_UL_ALL Enable all automatically discovered fields. This is the default - setting. + setting for the linkable library, but for the LD_PRELOAD variant, it + can be changed at the library's configure time. LOG_UL_NODISCOVER Disable all automatic discovery, and only include the *message*, -- cgit