summaryrefslogtreecommitdiffstats
path: root/sys-utils/dmesg.c
diff options
context:
space:
mode:
authorKarel Zak2014-10-14 10:20:19 +0200
committerKarel Zak2014-10-14 10:20:19 +0200
commit33ecab2b9cb77dd34fed1e6cf6394b88ef880f35 (patch)
treeed346cdfa4af6f59bb4d00a450d70fffa910b473 /sys-utils/dmesg.c
parenttests: add PMBR sfdisk test (diff)
downloadkernel-qcow2-util-linux-33ecab2b9cb77dd34fed1e6cf6394b88ef880f35.tar.gz
kernel-qcow2-util-linux-33ecab2b9cb77dd34fed1e6cf6394b88ef880f35.tar.xz
kernel-qcow2-util-linux-33ecab2b9cb77dd34fed1e6cf6394b88ef880f35.zip
dmesg: improve reltime colors
[ +0.004034] sd 113:0:0:0: [sdb] Attached SCSI disk [Oct10 13:04] sdb: unknown partition table [ +0.034011] sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 > .. the "Oct10 13:04" is possible to colorize by "timebreak" scheme (default is bold green). Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/dmesg.c')
-rw-r--r--sys-utils/dmesg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index 661aaa9d9..1a1ace4ab 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -71,6 +71,7 @@ struct dmesg_color {
enum {
DMESG_COLOR_SUBSYS,
DMESG_COLOR_TIME,
+ DMESG_COLOR_TIMEBREAK,
DMESG_COLOR_ALERT,
DMESG_COLOR_CRIT,
DMESG_COLOR_ERR,
@@ -82,6 +83,7 @@ static const struct dmesg_color colors[] =
{
[DMESG_COLOR_SUBSYS] = { "subsys", UL_COLOR_BROWN },
[DMESG_COLOR_TIME] = { "time", UL_COLOR_GREEN },
+ [DMESG_COLOR_TIMEBREAK] = { "timebreak",UL_COLOR_GREEN UL_COLOR_BOLD },
[DMESG_COLOR_ALERT] = { "alert", UL_COLOR_REVERSE UL_COLOR_RED },
[DMESG_COLOR_CRIT] = { "crit", UL_COLOR_BOLD UL_COLOR_RED },
[DMESG_COLOR_ERR] = { "err", UL_COLOR_RED },
@@ -921,6 +923,7 @@ static void print_record(struct dmesg_control *ctl,
if (cur.tm_min != ctl->lasttm.tm_min ||
cur.tm_hour != ctl->lasttm.tm_hour ||
cur.tm_yday != ctl->lasttm.tm_yday) {
+ dmesg_enable_color(DMESG_COLOR_TIMEBREAK);
printf("[%s] ", short_ctime(&cur, buf, sizeof(buf)));
} else {
if (delta < 10)