Mike Giacomelli | 7 Aug 2012 04:24
Picon
Favicon

New disk logging feature committed

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
(Continue reading)

Thomas Martitz | 9 Aug 2012 07:45
Favicon
Gravatar

Re: New disk logging feature committed

Am 07.08.2012 04:24, schrieb Mike Giacomelli:
> 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*/

I wonder why is RaaA excluded from this? Sure logging is something 
generally useful.

Best regards.

Mike Giacomelli | 9 Aug 2012 17:12
Picon
Favicon

RE: New disk logging feature committed


> I wonder why is RaaA excluded from this? Sure logging is something
> generally useful.
>


I don't know anything about Android, but someone said it had its own logging mechanism.  If you think its useful, feel free to add it.  
Frank Gevaerts | 9 Aug 2012 17:22
Picon

Re: New disk logging feature committed

On Thu, Aug 09, 2012 at 08:12:07AM -0700, Mike Giacomelli wrote:
> I don't know anything about Android, but someone said it had its own logging mechanism.  If you think its
useful, feel free to add it.   		 	   		  

I'd say on Android these log macros should wrap the android log
functions

Frank

--

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

Lorenzo Miori | 9 Aug 2012 19:07
Picon

Re: New disk logging feature committed

Indeed. Moreover, Rockbox is an application also on Samsung YP-R0,
which is the only application running on the device actually!
Therefore, I'm for expanding the log functionality also to RaaA :)

2012/8/9 Frank Gevaerts <frank <at> gevaerts.be>:
> On Thu, Aug 09, 2012 at 08:12:07AM -0700, Mike Giacomelli wrote:
>> I don't know anything about Android, but someone said it had its own logging mechanism.  If you think its
useful, feel free to add it.
>
> I'd say on Android these log macros should wrap the android log
> functions
>
> Frank
>
> --
> "Debugging is twice as hard as writing the code in the first place.
> Therefore, if you write the code as cleverly as possible, you are,
> by definition, not smart enough to debug it." - Brian W. Kernighan


Gmane