Message12620

Author jeff.allen
Recipients jeff.allen
Date 2019-08-04.16:30:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1564936233.76.0.720936312818.issue2778@roundup.psfhosted.org>
In-reply-to
Content
I think I can get this in the beta while we're waiting to resolve the website and other things.

I'm quite liking this correspondence:

>>> for v in range(-2, 8):
...     print v, Py.levelFromVerbosity(v)
...
-2 SEVERE
-1 SEVERE
0 WARNING
1 INFO
2 CONFIG
3 FINE
4 FINER
5 FINEST
6 ALL
7 ALL

These are not all valid levels in Jython, but it seems as good a response as any to other integer values to map them so. We can go the other way too:

>>> for level in (ALL, FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE, OFF):
...     print level, Py.verbosityFromLevel(level)
...
ALL 6
FINEST 5
FINER 4
FINE 3
CONFIG 2
INFO 1
WARNING 0
SEVERE -1
OFF -1

Our default level (no -v flag) is 1 = MESSAGE = INFO, which is also the Java default, so it nicely produces "least surprise". I'm not sure what to do about about OFF.

I've yet to discover at what points I need to use these functions to keep things in sync, but writing them seemed a good starting point. They may not be public in a release.
History
Date User Action Args
2019-08-04 16:30:33jeff.allensetmessageid: <1564936233.76.0.720936312818.issue2778@roundup.psfhosted.org>
2019-08-04 16:30:33jeff.allensetrecipients: + jeff.allen
2019-08-04 16:30:33jeff.allenlinkissue2778 messages
2019-08-04 16:30:33jeff.allencreate