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
Thu Jul 26 10:17:37 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 (#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 <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/20180726/89d65586/attachment.htm>


More information about the gerrit-log mailing list