From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] dmesg: restrict output to default log level by default
Date: Thu, 16 Jan 2025 15:07:52 +0100 [thread overview]
Message-ID: <20250116140752.298077-1-a.fatoum@pengutronix.de> (raw)
When loglevel is set to debug, dmesg shows a torrent of messages,
because by default it shows all messages logged regardless of the
default log level.
To make it more convenient to use, change this to only print the same
messages that are synchronously printed by default.
Users wanting to see more can specify a log level via an extra argument
to the dmesg command.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
commands/dmesg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commands/dmesg.c b/commands/dmesg.c
index 8a60f075076e..99675b6c2804 100644
--- a/commands/dmesg.c
+++ b/commands/dmesg.c
@@ -78,7 +78,7 @@ static int do_dmesg(int argc, char *argv[])
{
int opt, ret, i;
int delete_buf = 0, emit = 0;
- unsigned flags = 0, levels = 0;
+ unsigned flags = 0, levels = GENMASK(CONFIG_DEFAULT_LOGLEVEL, 0);
char *set = NULL;
while ((opt = getopt(argc, argv, "ctderl:n:")) > 0) {
--
2.39.5
next reply other threads:[~2025-01-16 14:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 14:07 Ahmad Fatoum [this message]
2025-01-21 7:59 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250116140752.298077-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox