Commit Graph

29 Commits

Author SHA1 Message Date
Karel Zak 636a6207d9 dmesg: add --level=<list>
For example

	dmesg --level=err,warn

will print only error and warning messages.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-13 15:50:47 +02:00
Karel Zak 5c8f6bc6df dmesg: consolidate level parsiig code
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-13 15:06:53 +02:00
Karel Zak b8300c0a1e dmesg: don't print non-printable chars, parse records
All non-printable chars, non-printable multibyte sequences or invalid
multibyte sequences will be replaced with \x<hex> strings.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-13 15:00:49 +02:00
Karel Zak f06ec64fda dmesg; support level names (e.g. --console-level=alert)
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-01 16:33:34 +02:00
Karel Zak 2170174ee3 dmesg: add --console-on and --console-off
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-01 15:30:16 +02:00
Karel Zak 0506537a10 dmesg: cleanup options and man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-01 14:56:22 +02:00
Karel Zak 0419986053 dmesg: add --clear (SYSLOG_ACTION_CLEAR)
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-01 14:33:27 +02:00
Karel Zak 48c5c66212 dmesg: refactoring - cleanup main() code
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-01 14:26:19 +02:00
Karel Zak 65e3eed924 dmesg: refactoring - cleanup read buffer code
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-01 14:15:07 +02:00
Karel Zak f4fa5b44df dmesg: refactoring - cleanup print buffer code
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-01 13:57:36 +02:00
Karel Zak eed99b2a7c dmesg: refactoring - cleanup get bufsize code
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-01 13:49:25 +02:00
Karel Zak 59a1489968 dmesg: use SYSLOG_ACTION_* macros rather than magic constatnts
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-01 13:41:56 +02:00
Karel Zak 4a3b794968 dmesg: add long options, --help and --version
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-01 13:36:11 +02:00
Marek Polacek 15103c4bc6 dmesg.c: cleanups -- use err(), xalloc()
Signed-off-by: Marek Polacek <mpolacek@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-02-28 10:10:32 +01:00
Davidlohr Bueso 15673c1598 dmesg: use strtol_or_err instead of atoi
We shouldn't be accepting things like 'dmesg -n 2crapinput'
This patch also changes the exit's value to use EXIT_* constants.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-02-08 15:40:48 +01:00
Davidlohr Bueso 219da9223d dmesg: fix memory leak in dmesg(1).
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-08-04 11:46:38 +02:00
Karel Zak e6c379eb8d dmesg: add -r to help output
On Tue, Aug 04, 2009 at 05:52:38PM +0200, Dalibor Straka wrote:
> while I was reading the source, I've noticed missing option in the
> help message for "-r". So I'm sending one-line patch for dmesg.

Reported-by: Dalibor Straka <dast@panelnet.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-08-17 11:37:27 +02:00
Adam Jackson 11ea22d5a3 dmesg: Add -r (raw) option.
Useful for debugging which kernel messages are ruining your quiet
bootup.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-01-16 12:34:49 +01:00
maximilian attems 5423ccb1a1 dmesg: nuke old glibc 5 support
dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘klogctl’
dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘type’
dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘b’
dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘len’

without belows compat section dmesg just compiles fine against klibc.
as bonus reorder the includes.

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:06:50 +02:00
Karel Zak c129767e06 Imported from util-linux-2.12b tarball. 2006-12-07 00:26:16 +01:00
Karel Zak df1dddf9ff Imported from util-linux-2.12 tarball. 2006-12-07 00:26:12 +01:00
Karel Zak ffc4374869 Imported from util-linux-2.11o tarball. 2006-12-07 00:25:53 +01:00
Karel Zak 364cda4857 Imported from util-linux-2.11f tarball. 2006-12-07 00:25:48 +01:00
Karel Zak c07ebfa1e0 Imported from util-linux-2.11b tarball. 2006-12-07 00:25:46 +01:00
Karel Zak 22853e4a82 Imported from util-linux-2.10m tarball. 2006-12-07 00:25:43 +01:00
Karel Zak 7eda085c41 Imported from util-linux-2.9v tarball. 2006-12-07 00:25:39 +01:00
Karel Zak 2b6fc908bc Imported from util-linux-2.8 tarball. 2006-12-07 00:25:35 +01:00
Karel Zak fd6b7a7ffc Imported from util-linux-2.7.1 tarball. 2006-12-07 00:25:34 +01:00
Karel Zak 6dbe3af945 Imported from util-linux-2.2 tarball. 2006-12-07 00:25:32 +01:00