manager: swap order in which we ellipsize/escape sd_notify() messages for debugging

If we have to chose between truncated escape sequences and strings
exploded to 4 times the desried length by fully escaping, prefer the
latter.

It's for debug only, hence doesn't really matter much.
This commit is contained in:
Lennart Poettering 2018-01-04 21:00:10 +01:00
parent 1ed34d75d4
commit da5fb86100
1 changed files with 3 additions and 2 deletions

View File

@ -1897,9 +1897,10 @@ static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, const
else if (DEBUG_LOGGING) {
_cleanup_free_ char *x = NULL, *y = NULL;
x = cescape(buf);
x = ellipsize(buf, 20, 90);
if (x)
y = ellipsize(x, 20, 90);
y = cescape(x);
log_unit_debug(u, "Got notification message \"%s\", ignoring.", strnull(y));
}
}