mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-16 22:18:07 +02:00
ovsdb: avoid creating JSON string for logging if logging is disabled
This commit is contained in:
parent
01e883f7d3
commit
c84340a9cb
1 changed files with 9 additions and 10 deletions
|
|
@ -279,18 +279,17 @@ static NM_UTILS_LOOKUP_STR_DEFINE(_device_type_to_table,
|
|||
static void
|
||||
_call_complete(OvsdbMethodCall *call, json_t *response, GError *error)
|
||||
{
|
||||
if (response) {
|
||||
gs_free char *str = NULL;
|
||||
gs_free char *str = NULL;
|
||||
|
||||
str = json_dumps(response, 0);
|
||||
if (error)
|
||||
_LOGT_call(call, "completed: %s ; error: %s", str, error->message);
|
||||
else
|
||||
_LOGT_call(call, "completed: %s", str);
|
||||
} else {
|
||||
nm_assert(error);
|
||||
nm_assert(response || error);
|
||||
|
||||
if (response) {
|
||||
_LOGT_call(call,
|
||||
"completed: %s%s%s",
|
||||
(str = json_dumps(response, 0)),
|
||||
NM_PRINT_FMT_QUOTED2(error, " ; error: ", error->message, ""));
|
||||
} else
|
||||
_LOGT_call(call, "completed: error: %s", error->message);
|
||||
}
|
||||
|
||||
c_list_unlink(&call->calls_lst);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue