The magic behaviour of 'logging level all LEVEL'

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/OpenBSC@lists.osmocom.org/.

Vadim Yanitskiy axilirator at gmail.com
Tue Jul 24 17:10:08 UTC 2018


Hi all,

A discussion was started during the review of
https://gerrit.osmocom.org/10116/.
The main idea of this change is to fix the behaviour of 'logging level all
LEVEL',
but I think it was also mixed with some additional feature, which I would
like
to discuss here, publicly.

First of all, the change introduces a new special logging level 'unset',
which allows one to reset a given category (i.e. unset its custom value):

  !! Initial logging configuration:
  logging level all error
  logging level mncc debug
  logging level pag notice
  logging level meas debug

  !! Resetting DMNCC:
  # logging level mncc unset

  !! So, now DMNCC has no custom log level, it will use
  !! the default level (in this example it is 'error'):
  logging level all error
  logging level pag notice
  logging level meas debug

This feature looks fine and extremely useful for me.

But (among fixing) this change additionally changes the behaviour
of a command for setting the default logging category (i.e. 'logging
level all LEVEL'):

  !! Initial logging configuration:
  logging level all error
  logging level mncc debug
  logging level pag notice
  logging level meas debug

  !! Changing the default logging level:
  # logging level all debug

  !! Ahhh, I've lost my custom levels :(
  logging level all debug

  !! What I expected to get:
  logging level all debug
  logging level mncc debug
  logging level pag notice
  logging level meas debug

So, together with changing the default logging category,
this command now would also reset all custom settings...

I am not sure this is exactly what one need/expect, so
I would like to share the following ideas:

  1) The category 'all' looks/sounds confusing when it's used
     in such cases like this:

       # logging level all debug

     because one can interpret it like:

       "set all categories to debug".

     despite actually (according to the implementation) this
     is related to the default logging policy.

     Maybe, we should rename it to 'default'?

     So, 'logging level all LEVEL' would *set all categories*
     to a given logging LEVEL, while 'logging level default LEVEL'
     would only affect the default logging level...

  2) Introducing the new command:

       # logging level unset LEVEL

     which is intended to assign a given LEVEL to all categories,
     which have no custom logging level (i.e. have 'unset'), would
     make the idea of having default logging policy meaningless.

     Setting logging level(s) for all possible categories (using this
     command), looks like writing iptables rules for all possible
     and impossible cases instead of using the DEFAULT policy...

  3) The introduced behaviour of resetting all categories to 'unset'
     could be implemented in a separate function, and can be
     represented by a separate command:

       # logging level unset-all

     The name of this command clearly defines the expected behaviour.
     Moreover, it doesn't affect the default logging level, which can be
     still changed by a separate command.

As we (me and Pau) have different opinions, or we simply don't
understand each other, let's make this discussion public, and
let's see what others think about this...

With best regards,
Vadim Yanitskiy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20180725/ed2cbac8/attachment.htm>


More information about the OpenBSC mailing list