[PATCH 1/2] log: new --log-func-loc option to enable function location in logs

Aleksander Morgado aleksander at aleksander.es
Thu May 18 12:40:52 UTC 2017


On Thu, May 18, 2017 at 2:22 PM, Colin Helliwell
<colin.helliwell at ln-systems.com> wrote:
>> > The --debug output is a bit annoying right now because it includes
>> > the
>> > function location information by default. This information is most of
>> > the times not very useful, so just make it optional under a new
>> > command line argument for the daemon.
>>
>> Hi,
>>
>> For NetworkManager you cannot configure the bits that are logged. The
>> reasoning is, that a user reporting a bug usually wouldn't tweak the
>> logging format. Imagine you have to ask the reporter for enabling debug
>> level, turn on time-stamping, file-location, etc.
>>
>
>
> Personally I do find the location useful (file/function) *but*, to make logfiles a bit easier to digest on a VT100 [joking...], I mod the source so that the file path is relative rather than absolute - just makes the log lines a bit/lot shorter.
> Don't know if that sort of compromise would be of value?

When custom building the tree from within srcdir you'd get the
relative paths by default, not very annoying... I've seen the absolute
paths in logs when its e.g. cross compiled and such, though. The
__FILE__ contents really depend on how the build setup passes files to
gcc IIRC, and we could just setup some macro to basename whatever we
get in __FILE__, if needed. This, assuming we decide to leave that
option, from my POV the two options we should consider is either make
the func:loc optional (basenamed or not) or just get rid of it
completely...

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list