mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nick Andrew <nick@nick-andrew.net>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	joe@perches.com
Subject: [PATCH 2/2] printk: Remember the message level for multi-line output
Date: Sun, 13 Apr 2008 21:54:20 +1000	[thread overview]
Message-ID: <20080413115351.29086.40504.stgit@marcab.local.tull.net> (raw)
In-Reply-To: <20080413115152.29086.37845.stgit@marcab.local.tull.net>

printk: Remember the message level for multi-line output

    printk(KERN_ALERT "Danger Will Robinson!\nAlien Approaching!\n");

At present this will result in one message at ALERT level and one
at the current default message loglevel (e.g. WARNING). This is
non-intuitive.

Modify vprintk() to remember the message loglevel each time it
is specified and use it for subsequent lines of output which do
not specify one, within the same call to printk.

Signed-off-by: Nick Andrew <nick@nick-andrew.net>
---

 kernel/printk.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)


diff --git a/kernel/printk.c b/kernel/printk.c
index bca9359..5c97eb1 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -716,8 +716,6 @@ asmlinkage int vprintk(const char *fmt, va_list args)
 				current_log_level = p[1] - '0';
 				p += 3;
 				printed_len -= 3;
-			} else {
-				current_log_level = default_message_loglevel;
 			}
 
 			/* Always output the token */


  reply	other threads:[~2008-04-13 11:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-13 11:53 [PATCH 1/2] printk: Refactor processing of line severity tokens Nick Andrew
2008-04-13 11:54 ` Nick Andrew [this message]
2008-04-13 12:26 ` Nick Andrew
2008-04-14  7:58   ` Ingo Molnar
2008-04-13 12:27 ` [PATCH 2/2] printk: Remember the message level for multi-line output Nick Andrew
2008-04-14  8:03   ` Ingo Molnar
2008-04-14 10:12     ` Nick Andrew
2008-04-14 10:26       ` Ingo Molnar
2008-04-14 11:03         ` Nick Andrew
2008-04-14 11:43         ` Johannes Weiner
2008-04-14 12:21           ` Ingo Molnar

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=20080413115351.29086.40504.stgit@marcab.local.tull.net \
    --to=nick@nick-andrew.net \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®