View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0005164 | GNUnet | util library | public | 2017-10-27 17:10 | 2018-01-12 12:16 |
| Reporter | lynX | Assigned To | Christian Grothoff | ||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | closed | Resolution | no change required | ||
| Product Version | Git master | ||||
| Target Version | 0.11.0pre66 | Fixed in Version | 0.11.0pre66 | ||
| Summary | 0005164: How to compile gnunet without tons of debug messages in the binaries? | ||||
| Description | The 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 | ||||
| Tags | No tags attached. | ||||
|
|
Sounds good to me to have a distinction between debug and user-level/mostly informative messages. |
|
|
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. |
|
|
Closing as DEBUG level already does what Carlo wants. |
| 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 |