View Issue Details

IDProjectCategoryView StatusLast Update
0005164GNUnetutil librarypublic2018-01-12 12:16
ReporterlynX Assigned ToChristian Grothoff  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionno change required 
Product VersionGit master 
Target Version0.11.0pre66Fixed in Version0.11.0pre66 
Summary0005164: How to compile gnunet without tons of debug messages in the binaries?
DescriptionThe GNUNET_log mechanism has become quite powerful over time, making it the
de-facto output mechanism also for regular (MESSAGE, INFO) output, not just
errors and debugging hints.

Currently the entire logging system can be disabled at compilation time using GNUNET_CULL_LOGGING (or its configure setting), but then CLI tools will not produce meaningful output also for all the non-debug purposes. Therefore, even
in low memory situationsm gnunet will have to be compiled with every little
debug message in the code, even if it never gets activated.

That's why I was thinking of making a distinction between GNUNET_log() and
a new GNUnet_debug() which can easily be #define'd to be empty while the
other one is still fully operational. I appended a proposed patch to
src/include/gnunet_common.h that would introduce debugging whenever the
GNUNET_EXTRA_LOGGING flag is provided.

A suitable auto-conversion script could replace all the cases where
GNUNET_ERROR_TYPE_BULK is used into GNUnet_debug(). Would that be a good
idea?
Additional Information+/**
+ * Complete disabling of GNUNET_log is rarely useful, as all regular CLI outputs
+ * are also produced with it. So, if we don't want debug messages to pollute the
+ * end-user binaries by default, we need a separate wrapper for them.
+ */
+#if GNUNET_EXTRA_LOGGING > 0
+#define GNUNET_debug(...) GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__)
+#define GNUNET_debug_from(...) GNUNET_log_from(GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__)
+#else
+#define GNUNET_debug(...)
+#define GNUNET_debug_from(...)
+#endif
TagsNo tags attached.

Activities

nikita

2017-10-28 12:34

reporter   ~0012518

Sounds good to me to have a distinction between debug and user-level/mostly informative messages.

Christian Grothoff

2017-12-10 22:43

manager   ~0012660

I'm confused. By default, DEBUG messages are not compiled in, you need to set --enable-logging=verbose to get them into the binary. So AFAIK what Lynx suggests is already implemented/available.

Christian Grothoff

2018-01-12 12:16

manager   ~0012772

Closing as DEBUG level already does what Carlo wants.

Issue History

Date Modified Username Field Change
2017-10-27 17:10 lynX New Issue
2017-10-28 12:34 nikita Note Added: 0012518
2017-12-10 22:43 Christian Grothoff Note Added: 0012660
2018-01-12 12:16 Christian Grothoff Assigned To => Christian Grothoff
2018-01-12 12:16 Christian Grothoff Severity minor => feature
2018-01-12 12:16 Christian Grothoff Status new => closed
2018-01-12 12:16 Christian Grothoff Resolution open => no change required
2018-01-12 12:16 Christian Grothoff Product Version => Git master
2018-01-12 12:16 Christian Grothoff Fixed in Version => 0.11.0pre66
2018-01-12 12:16 Christian Grothoff Target Version => 0.11.0pre66
2018-01-12 12:16 Christian Grothoff Note Added: 0012772