This is annoyingly verbose when there are no arguments. Drop the
location details and the "with arguments" noise. Arguments are now in
square brackets, when present.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
return ret;
}
- DEBUG(DEBUG_INFO,
- (__location__ " Running event %s with arguments %s\n",
- ctdb_event_to_string(event), arg_str));
+ if (DEBUGLEVEL >= DBGLVL_INFO) {
+ if (arg_str == NULL || arg_str[0] == '\0') {
+ D_INFO("Running event: %s\n",
+ ctdb_event_to_string(event));
+ } else {
+ D_INFO("Running event: %s [%s]\n",
+ ctdb_event_to_string(event),
+ arg_str);
+ }
+ }
talloc_free(arg_str);
return 0;