--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
I'm not sure I understand. Do you want to use the existing 'logcat'
program to save the logs, or do you want to write a new program
that saves logs, while preserving the ability of 'logcat' to also
show android logs from the command line?
The loglevel specified in init.rc only affects the logging emitted by
'init'. It doesn't affect the logging of any of the rest of the system.
That is, various parts of the init program issue log messages, with
log levels, when the program does certain actions. The init.rc loglevel
controls which of these will actually be written to the log by the
'init' program.
Does 3) mean you want to control what log messages are saved in your
persistent log file (in the file system)? Or are you trying to
control what messages are saved into the kernel log buffers to
begin with?
There's a writeup of the logging system, with a nice diagram, at:
http://elinux.org/Android_Logging_System
Note that the android logging system is completely separate from
the Linux kernel log system (which uses printk inside the kernel
to save messages and dmesg to extract them). You can write to
the kernel log from user space by writing to /dev/kmsg.
I've seen a reference to couple the two together, to redirect
android messages into the kernel log buffer, using the 'logcat'
program launched from init, like below:
service logcat /system/bin/logcat -f /dev/kmsg
oneshot
However, this seems really wasteful of space (and time), since it
basically buffers each log message twice. Also, for your intended use
(saving messages to a file), this re-logging of messages into the kernel
log buffer seems orthogonal.
I hope this helps.
-- Tim
=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Network Entertainment
=============================