Change in libosmocore[master]: logging: Fix logging level all

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Tue Jul 24 15:19:26 UTC 2018


Hello Vadim Yanitskiy, Neels Hofmeyr, Harald Welte, Jenkins Builder, 

I'd like you to reexamine a change. Please visit

    https://gerrit.osmocom.org/10116

to look at the new patch set (#2).

Change subject: logging: Fix logging level all
......................................................................

logging: Fix logging level all

This commit fixes "logging level all <loglevel>" to have a behavior
which makes sense.

First, old "everything" loglevel is moved and re-used as
"unset", which can be used to set loglevel for a given category to
whatever the logtarget defaults to. This is done because it's handy to
have "unset" in pos 0 since it's the default level for all categories
until they are explicitly set. Furthermore, we don't care about
position/number of "everything" level because nowadays it's deprecated
and never assigned anymore (and it never had a public define value),
and string only kept for VTY compatibility until it is totally removed
in the future.

When using "logging level all", VTY sets default log level to <loglevel>
and resets all log categories to UNSET. Then user can specify specific
log levels for specific categories using "logging level <cat> <loglevel>".

For instance:
log stderr
 logging level all error
 logging level l1p notice

Will print ERROR messages for all categories and NOTICE+ERROR messages
for L1P category.

Another example: In the VTY, while debugging:
* logging level all error  -> Only all ERRORs are printed
* logging level l1p debug -> all INFO+NOTICE+ERROR for L1P, and all ERROR are printed.
Now, user is interested to debug some other category, eg. TRX:
* logging level l1p unset -> L1P goes back to target default (ERROR)
* logging level trx debug -> we get all TRX logs.

Fixes: OS#3409
Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff
---
M include/osmocom/core/logging.h
M src/logging.c
M src/vty/logging_vty.c
3 files changed, 32 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/10116/2
-- 
To view, visit https://gerrit.osmocom.org/10116
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff
Gerrit-Change-Number: 10116
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180724/8de2bf14/attachment.htm>


More information about the gerrit-log mailing list