build: add --enable-more-logging configure option
authorThomas Haller <thaller@redhat.com>
Fri, 10 Apr 2015 05:39:14 +0000 (07:39 +0200)
committerThomas Haller <thaller@redhat.com>
Fri, 10 Apr 2015 16:08:09 +0000 (18:08 +0200)
NM core uses nm-logging which is entirely configurable at runtime.
Other components use glib-logging, which can also be partly configured
via G_MESSAGES_DEBUG.

It makes sense to have a compile time option to enable some
logging statements that are only useful for heavy debugging.

For glib-logging, this is a way to enable/disable extra logging.
For nm-logging, we could alternatively configure a least log-level
that is enabled at compile time (that way, we could configure to prune all
LOGL_TRACE logging). While that might be useful (too), this gives
an alternative way to disable/enable logging.

Add a configure option --enable-more-logging and a NM_MORE_LOGGING define
for that.

If we don't find this useful after a while, we can simply remove it,
because our logging statements are not part of a "stable" behavior.

configure.ac

index ce3ea7b..e2a452b 100644 (file)
@@ -856,6 +856,12 @@ if test "${enable_more_asserts}" = "yes"; then
     AC_DEFINE(NM_MORE_ASSERTS, [1], [Define if more asserts are enabled])
 fi
 
+AC_ARG_ENABLE(more-logging,
+              AS_HELP_STRING([--enable-more-logging], [Enable more debug logging (default: no)]))
+if test "${enable_more_logging}" = "yes"; then
+    AC_DEFINE(NM_MORE_LOGGING, [1], [Define if more asserts are enabled])
+fi
+
 AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], [Enable Link Time Optimization for smaller size (default: no)]))
 if (test "${enable_lto}" = "yes"); then
     CFLAGS="-flto $CFLAGS"