Skip to content

Commit

Permalink
lib: Change event_set_forced_debug(e, FALSE) to be a no-op
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef 'Jeff' Sipek committed Jun 30, 2018
1 parent ccf7e2a commit 6940c43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/lib/event-log.c
Expand Up @@ -206,7 +206,8 @@ void event_logv(struct event *event, const struct event_log_params *params,

struct event *event_set_forced_debug(struct event *event, bool force)
{
event->forced_debug = force;
if (force)
event->forced_debug = TRUE;
return event;
}

Expand Down
8 changes: 2 additions & 6 deletions src/lib/event-log.h
Expand Up @@ -58,12 +58,8 @@ void event_logv(struct event *event, const struct event_log_params *params,
afterwards. It doesn't apply to existing child events (mainly for
performance reasons).
Note that it's always recommended to use e.g.:
if (set->debug) event_set_forced_debug(event, TRUE); // good
instead of
event_set_forced_debug(event, set->debug); // bad
This is because the event may already have had debugging enabled via the
parent event. Forcing it to FALSE is most likely not wanted. */
Note that event_set_forced_debug(event, FALSE) is a no-op. To disable
forced-debug, use event_unset_forced_debug(event). */
struct event *event_set_forced_debug(struct event *event, bool force);
/* Set the forced-debug to FALSE */
struct event *event_unset_forced_debug(struct event *event);
Expand Down

0 comments on commit 6940c43

Please sign in to comment.