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 (#3).

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 now sets the log level to <loglevel>
for each category available in that logtarget, instead of setting the
global default one. A new API log_set_log_level_all() is added to
libosmocore for that. Old API log_set_log_level() is kept as is as it
is still used by osmocom applications which set global loglevel through
"-e" cmd line parameter. This old API will also be used in next commit
to implement a new VTY command to set the global default level in the
same way.

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 DBG+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, 40 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/10116/3
--
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: 3
Gerrit-Owner: Pau Espin Pedrol <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Pau Espin Pedrol <[email protected]>
Gerrit-Reviewer: Vadim Yanitskiy <[email protected]>

Reply via email to