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 <pes...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>

Reply via email to