Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: New disk logging feature committed

New disk logging feature committed

From: Mike Giacomelli <giac2000_at_hotmail.com>
Date: Mon, 6 Aug 2012 22:24:34 -0400

Hi Everyone,

I've committed the new disk logging system. Its now enabled for all
devices, but requires developers to use it to be really useful. That
means updating code you're working on to output useful debug
information. To help with this the system has 3 levels:

ERRORF(...) /*serious errors or problems*/
WARNF(...) /*matters of concern*/
NOTEF(...) /*useful for debug only*/

Each level works exactly like DEBUGF/LOGF except they pass data into a
buffer (currently between 1-8KB depending on available memory) that is
periodically flushed to disk. This only happens on spin up, so there
should be no battery cost to logging. However, for default builds,
only ERRORF defines are compiled in. The rest are silently dropped by
the preprocessor to avoid cluttering normal builds with unnecessary
information.

Therefore, when writing code, you should make any error messages that
users may be concerned about use ERRORF, while WARNF should be used
for less serious concerns. Finally, NOTEF is intended to work like
DEBUGF/LOGF currently does, and will probably be merged with DEBUGF at
some point in the future. The goal here should be to give ordinary
users a way to figure out why something failed, and also a way to
provide us with clues when they report difficult to reproduce bugs.
Think carefully about how important a message is. If it is likely to
be followed by a crash or failure to do some expected action (play
file, run plugin function, build database, load theme) it should
probably be an ERRORF. If a message is likely to be non-fatal or lead
to a condition the code can otherwise handle gracefully, its probably
better to use WARNF to avoid cluttering log files.

As an example of how this can be used, I've prepared a simple patch
that enables logging of a number of error conditions in various codec
files:

http://gerrit.rockbox.org/r/#/c/292/

In the future I want to add this to more codecs, as well as bits of
the core (themes, database, buffering, USB, plugins, etc).

Mike
Received on 2012-08-07


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa