lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Consistent filtering of debug messages?


From: Jonathan Larmour
Subject: Re: [lwip-users] Consistent filtering of debug messages?
Date: Thu, 13 Nov 2008 16:08:11 +0000
User-agent: Thunderbird 1.5.0.12 (X11/20070530)

Kieran Mansley wrote:
> On Thu, 2008-11-13 at 13:27 +0000, Tamas Somogyi wrote:
>> Hi All,
>>
>> I'd like to filter the debug messages coming through LWIP_DEBUGF and
>> display only the "important" ones, which indicate possible errors. It
>> would be quite useful for me, running on embedded system I'd like to see
>> if something unexpected happens and needs attention - but on the other
>> hand I'd like to suppress the tons of normal traces.
>>
>> I think that's the purpose of LWIP_DBG_LEVEL_WARNING,
>> LWIP_DBG_LEVEL_SERIOUS and LWIP_DBG_LEVEL_SEVERE constants, but I
>> noticed that these are interpreted differently in different files.
>> E.g. pbuf.c uses SEVERE for important -but normal- messages:
>>   LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 3, ("pbuf_alloc(length=...
>> while tcp_out.c indicates unexpected situation:
>>     LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_enqueue: too much data... 
>>
>> The message type (trace, state...) should be used consistently as well.
>>
>> Because of the abovementioned reasons, I cannot see any straightforward
>> way to filter the messages. Can you please suggest a good, general
>> solution for keeping those messages only which indicate unexpected
>> situations?
> 
> I doubt there is a good solution for what you want other than to change
> the messages that have the wrong log level.  The message you point out
> in pbuf.c that is using SEVERE for a mundane message is probably a bug.
> If you find any more like it, I would welcome a patch to change them.

Not sure about that actually - it also includes LWIP_DBG_TRACE. I would
have thought the intent was to have a higher priority trace message, should
tracing be on.

I think the problem is more general in the debug flag config.  Setting
LWIP_DBG_TYPES_ON seems slightly wonky; it only serves to restrict the
types to "trace", "state" or "fresh". But if you set it to anything other
than LWIP_DBG_ON, you lose the normal messages too.


Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine




reply via email to

[Prev in Thread] Current Thread [Next in Thread]