加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-allow-override-default-log-level-by-environment-variable.patch 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
From cd6ec641deaf94e2eb2fcaf87b9236f65479ef3f Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Sat, 6 Jan 2024 03:27:07 +0900
Subject: [PATCH] udevadm: allow to override the default log level by
environment variable
Previously, there was no way to override the log level for test and
test-builtin commands. Let's re-parse environment after setting the log
level to debug. Then, we can control the log level through environment
variable.
(cherry picked from commit 7ba3e44651d43d8bc3644b991a060842649a34a7)
---
src/udev/udevadm-test-builtin.c | 1 +
src/udev/udevadm-test.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/udev/udevadm-test-builtin.c b/src/udev/udevadm-test-builtin.c
index f5498a1e5b1..088b4da3c1a 100644
--- a/src/udev/udevadm-test-builtin.c
+++ b/src/udev/udevadm-test-builtin.c
@@ -78,6 +78,7 @@ int builtin_main(int argc, char *argv[], void *userdata) {
int r;
log_set_max_level(LOG_DEBUG);
+ log_parse_environment();
r = parse_argv(argc, argv);
if (r <= 0)
diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c
index 809143ede0b..e1afd7d29e6 100644
--- a/src/udev/udevadm-test.c
+++ b/src/udev/udevadm-test.c
@@ -95,6 +95,7 @@ int test_main(int argc, char *argv[], void *userdata) {
int r;
log_set_max_level(LOG_DEBUG);
+ log_parse_environment();
r = parse_argv(argc, argv);
if (r <= 0)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化