unit: tweak status output a bit

Let's highlight the unit description string in the status updates, to
separate them a bit more the english sentence they are part of, and thus
make the different casing less surprising.
This commit is contained in:
Lennart Poettering 2018-11-23 17:46:25 +01:00
parent ccfc08d4bc
commit 5b262f74e4

View file

@ -46,6 +46,7 @@
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
#include "umask-util.h"
#include "unit-name.h"
#include "unit.h"
@ -1644,12 +1645,17 @@ static bool unit_assert_test(Unit *u) {
}
void unit_status_printf(Unit *u, const char *status, const char *unit_status_msg_format) {
const char *d;
d = unit_description(u);
if (log_get_show_color())
d = strjoina(ANSI_HIGHLIGHT, d, ANSI_NORMAL);
DISABLE_WARNING_FORMAT_NONLITERAL;
manager_status_printf(u->manager, STATUS_TYPE_NORMAL, status, unit_status_msg_format, unit_description(u));
manager_status_printf(u->manager, STATUS_TYPE_NORMAL, status, unit_status_msg_format, d);
REENABLE_WARNING;
}
int unit_start_limit_test(Unit *u) {
const char *reason;