7 Aug 2012 04:24
New disk logging feature committed
Mike Giacomelli <giac2000 <at> hotmail.com>
2012-08-07 02:24:34 GMT
2012-08-07 02:24:34 GMT
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)
RSS Feed