[Contents] [TitleIndex] [WordIndex

1. SEP: Warning Level

2. Abstract

There are 3 distinct topics:

  1. become able to identify each warning() with an id, and then become able to switch it "on" or "off" in a specific targeted way.
  2. become able to define which action a triggered warning must do:
    1. up to now, it was only possible to display a message set as warning() input parameter.
    2. warning("stop") tends to make a (specific) warning to stop instead of only displaying a message.
    3. Currently, the only difference with error() is that an error() can't be turned off.
    4. we could rather think about a more general "do_on_trigger" action, "stop" being a too specific case that should not be defined as is.
  3. Manage graded warning levels instead of a binary "on"|"off" coupled to a set of specific functions "warning()", "error()", ...: notice (mainly information messages) < warning (beware) < error

Moreover, there are 2 distinct types of calls:

3. Requirements

As you, I think that leveling warning() / error() is a task quite independent from both other topics. But we could anticipate the evolution. I do not think that it should be rejected in an external toolbox, because it's a "central common device" for flow-control. But it could be done later. Would it be complicated to implement it, without respect to existing warning() and error() in all existing codes?

What about the proposal https://codereview.scilab.org/#/c/18041/3 ? IMO,

So, which prototypes could we dream about? :)

If <level> is provided,

BUT: to implement that, a look-up table of warnings shall be set and stored somewhere. This looks similar to the gettext() philosophy: AFAIU, all warning tags shall be harvested when compiling the code.

So: a library of macros shall have a new component (in the lib file) = list of warnings tags (and levels) defined in its public and privates functions.

  1. need to modify genlib(). The new xml format of the "lib" file could have a new xml tag.
  2. need to modify load() (and/or its duplicate lib()) : to read warning tags from the library and merge them in the overall list.
  3. need to modify execstr() and deff()...

This is a lot of work...

Now, i may understand from your proposal that you don't want to go on this way. You might want to define the look-up table of tagNames only from the setting point of view. If so, i am sorry, but i think it is better to not implement this "tag" feature, because it would be hardly usable.

The ["do", instructions] feature does not need such a table. It could already be a great improvement, with warning() overloading.

By the way: despite the announcement, the localization of functions with gettext()==_() in external modules has never worked: http://bugzilla.scilab.org/13796

Is it because such a "harvest+registering" procedure is actually not yet implemented for gettext() out of Scilab? This opening had not been discussed, and if finally still unavailable.

Then, this "warning() discussion" could be the opportunity to implement both (at least for functions. For built-in, how to do?)

There were my lengthy thoughts, likely wrong on some aspects.

4. Related topics

The following bugs have been entered on bugzilla to track similar or related problems / wishlist

4.2. Mailling list threads

from http://mailinglists.scilab.org/warning-Extending-management-mode-for-a-specific-message-td4033934.html

4.3. Other software

5. Examples


CategorySep


2022-09-08 09:27