summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-05-14 12:50:33 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-05-14 14:29:53 +0200
commit9ab7a8d2a30f440c008d127113419030e4572cb4 (patch)
treed7e8f92fe9aad4c5ed4bca5d5e00ee5d6805b8b8 /src/core/unit.c
parent5f23d5b149513d98bb90df8cb912b6f567bed89f (diff)
unit: print the color status marks on the left
The alignment of the "[ OK ]" and "[FAILED]" status marks to the right side of the terminal makes it difficult to link them with the messages on the left if your console is wide. I considered the options: 1. Align them to the 80th column regardless of the console width. Disadvantage - either: - truncating messages needlessly, not using available space; or - If the message is long, write the mark over it. => ugly 2. Write them to the 80th column for short messages, and further to the right for longer ones. Disadvantage: - jagged look 3. Write the marks on the left, before the message. Disadvantage: - Breaks tradition from RHL. Advantages: + slightly simpler code + Will annoy holy-traditionalists. I chose option 3. BTW, Debian now uses similar marks on the left with its makefile-style boot. Special values of the "status" argument to status_vprintf are: NULL - no status mark, no message indentation "" - no status mark, message indented as if the mark was there
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 68948574ed..ddcfad5912 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -981,7 +981,7 @@ int unit_start(Unit *u) {
unit_add_to_dbus_queue(u);
- unit_status_printf(u, NULL, "Starting %s...", unit_description(u));
+ unit_status_printf(u, "", "Starting %s...", unit_description(u));
return UNIT_VTABLE(u)->start(u);
}
@@ -1023,7 +1023,7 @@ int unit_stop(Unit *u) {
unit_add_to_dbus_queue(u);
- unit_status_printf(u, NULL, "Stopping %s...", unit_description(u));
+ unit_status_printf(u, "", "Stopping %s...", unit_description(u));
return UNIT_VTABLE(u)->stop(u);
}