From 33ecab2b9cb77dd34fed1e6cf6394b88ef880f35 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 14 Oct 2014 10:20:19 +0200 Subject: 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 --- sys-utils/dmesg.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys-utils/dmesg.c') 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) -- cgit v1.2.3-55-g7522