1 Star 0 Fork 49

李双全/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0119-logs-show-use-grey-color-for-de-emphasizing-journal-.patch 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-01-20 13:59 . import systemd-239-29.el8.src.rpm
From 67b548434f258224239e41672478a0038d5c9d30 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 5 Dec 2018 18:42:32 +0100
Subject: [PATCH] logs-show: use grey color for de-emphasizing journal log
output
(cherry picked from commit 67df9b7a06d749fdd84f19f7d75ccf0d743f6d72)
Resolves: #1695601
---
src/basic/terminal-util.h | 2 ++
src/shared/logs-show.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/src/basic/terminal-util.h b/src/basic/terminal-util.h
index c0bd0e67a6..0055b72343 100644
--- a/src/basic/terminal-util.h
+++ b/src/basic/terminal-util.h
@@ -18,6 +18,7 @@
#define ANSI_MAGENTA "\x1B[0;35m"
#define ANSI_CYAN "\x1B[0;36m"
#define ANSI_WHITE "\x1B[0;37m"
+#define ANSI_GREY "\x1B[0;2;37m"
/* Bold/highlighted */
#define ANSI_HIGHLIGHT_BLACK "\x1B[0;1;30m"
@@ -129,6 +130,7 @@ DEFINE_ANSI_FUNC(highlight_yellow, HIGHLIGHT_YELLOW);
DEFINE_ANSI_FUNC(highlight_blue, HIGHLIGHT_BLUE);
DEFINE_ANSI_FUNC(highlight_magenta, HIGHLIGHT_MAGENTA);
DEFINE_ANSI_FUNC(normal, NORMAL);
+DEFINE_ANSI_FUNC(grey, GREY);
DEFINE_ANSI_FUNC_UNDERLINE(underline, UNDERLINE, NORMAL);
DEFINE_ANSI_FUNC_UNDERLINE(highlight_underline, HIGHLIGHT_UNDERLINE, HIGHLIGHT);
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index 33afbe2f7f..c66e39d2fe 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -170,6 +170,10 @@ static bool print_multiline(
color_on = ANSI_HIGHLIGHT;
color_off = ANSI_NORMAL;
highlight_on = ANSI_HIGHLIGHT_RED;
+ } else if (priority >= LOG_DEBUG) {
+ color_on = ANSI_GREY;
+ color_off = ANSI_NORMAL;
+ highlight_on = ANSI_HIGHLIGHT_RED;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shqli/systemd.git
git@gitee.com:shqli/systemd.git
shqli
systemd
systemd
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385