Re: [Zope-dev] Re: zLOG module deprecated
On 1/9/06, Andreas Jung <lists@andreas-jung.com> wrote:
ZODB defines these levels but I can not see any code in the ZODB package that actually uses these levels.
Nobody should be using the zLOG levels with the logging package, but rather use the logging package levels. So in the end, there's no need for Zope to be defining levels at all, only conventions for how the levels are used. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> "There is no wealth but life." --John Ruskin
--On 9. Januar 2006 10:55:21 -0500 Fred Drake <fdrake@gmail.com> wrote:
On 1/9/06, Andreas Jung <lists@andreas-jung.com> wrote:
ZODB defines these levels but I can not see any code in the ZODB package that actually uses these levels.
Nobody should be using the zLOG levels with the logging package, but rather use the logging package levels. So in the end, there's no need for Zope to be defining levels at all, only conventions for how the levels are used.
ZEO is doing that :-) All code on the trunk uses (since yesterday) the standard logging level (called through logger.info(), logger.error() etc.) -aj
On 9 Jan 2006, at 16:55, Fred Drake wrote:
On 1/9/06, Andreas Jung <lists@andreas-jung.com> wrote:
ZODB defines these levels but I can not see any code in the ZODB package that actually uses these levels.
Nobody should be using the zLOG levels with the logging package, but rather use the logging package levels. So in the end, there's no need for Zope to be defining levels at all, only conventions for how the levels are used.
My point is that the python logging levels are insufficiently fine grained. The python logging framework leaves room for numeric levels and registering equivalent strings, and indeed ZODB and zLOG have them defined. I want to use them. Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
On 1/9/06, Florent Guillaume <fg@nuxeo.com> wrote:
My point is that the python logging levels are insufficiently fine grained. The python logging framework leaves room for numeric levels and registering equivalent strings, and indeed ZODB and zLOG have them defined.
I want to use them.
Do you need someone else to define a constant for the level you want before you can use them? There's a API in the logging module that allows you to pass the desired level in. I see no reason to require a constant to be defined outside your code. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> "There is no wealth but life." --John Ruskin
On 9 Jan 2006, at 17:20, Fred Drake wrote:
On 1/9/06, Florent Guillaume <fg@nuxeo.com> wrote:
My point is that the python logging levels are insufficiently fine grained. The python logging framework leaves room for numeric levels and registering equivalent strings, and indeed ZODB and zLOG have them defined.
I want to use them.
Do you need someone else to define a constant for the level you want before you can use them? There's a API in the logging module that allows you to pass the desired level in. I see no reason to require a constant to be defined outside your code.
It's useful to have them standardized so that the logging module can output a standard string for them in the logs. Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
--On 9. Januar 2006 17:06:25 +0100 Florent Guillaume <fg@nuxeo.com> wrote:
My point is that the python logging levels are insufficiently fine grained.
Sufficently enough for me. BLATHER & TRACE can be merged to DEBUG and PROBLEM to either WARN|ERROR. This should be even enough for Zope.
The python logging framework leaves room for numeric levels and registering equivalent strings, and indeed ZODB and zLOG have them defined.
Of course zLOG has all levels defined for backward compatibility. An application should possibly defines its own logger with all possibilities the logging module offers when it has the need for additional logging levels. -aj
On 9 Jan 2006, at 17:25, Andreas Jung wrote:
--On 9. Januar 2006 17:06:25 +0100 Florent Guillaume <fg@nuxeo.com> wrote:
My point is that the python logging levels are insufficiently fine grained.
Sufficently enough for me.
"Sufficient for me" is not a good reason sorry. If you don't want to use them, then don't use them.
BLATHER & TRACE can be merged to DEBUG and PROBLEM to either WARN|ERROR. This should be even enough for Zope.
No it can't. TRACE is already being used, and it would drown everyone using DEBUG if it was at DEBUG level. Same thing, BLATHER would drown people looking for succint INFO.
The python logging framework leaves room for numeric levels and registering equivalent strings, and indeed ZODB and zLOG have them defined.
Of course zLOG has all levels defined for backward compatibility. An application should possibly defines its own logger with all possibilities the logging module offers when it has the need for additional logging levels.
I will standardize those for the use case we're seeing time and again and again. - verbose INFO -> BLATHER, which i want to rename VERBOSE - verbose DEBUG -> TRACE Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
--On 9. Januar 2006 17:40:26 +0100 Florent Guillaume <fg@nuxeo.com> wrote:
On 9 Jan 2006, at 17:25, Andreas Jung wrote:
--On 9. Januar 2006 17:06:25 +0100 Florent Guillaume <fg@nuxeo.com> wrote:
My point is that the python logging levels are insufficiently fine grained.
Sufficently enough for me.
"Sufficient for me" is not a good reason sorry. If you don't want to use them, then don't use them.
I've never had the need to use them. That's different from not wanting to use them. The more choice you have, the more trouble you have. I agree that a TRACE level might be of interest. But BLATHER and PROBLEM is competely overhead from my point of view - in fact I can't explain when to use BLATHER or TRACE compared to DEBUG. In cases where I have the need to perform low-level logging (for debugging purposes) I do usually use a dedicated logger to do not mess up the main logfile.
BLATHER & TRACE can be merged to DEBUG and PROBLEM to either WARN|ERROR. This should be even enough for Zope.
No it can't. TRACE is already being used, and it would drown everyone using DEBUG if it was at DEBUG level. Same thing, BLATHER would drown people looking for succint INFO.
I don't see any Zope code using TRACE except ZEO. Instead of BLATHER you could use DEBUG.
I will standardize those for the use case we're seeing time and again and again.
I don't like the idea of re-introducing something that matches on 'log'. Otherwise we could have kept zLOG :-) -aj
Andreas Jung wrote at 2006-1-9 18:06 +0100:
... I've never had the need to use them. That's different from not wanting to use them. The more choice you have, the more trouble you have. I agree that a TRACE level might be of interest. But BLATHER and PROBLEM is competely overhead from my point of view
"PROBLEM" is a synomym for warning. Surely, you want something between "info" and "error". -- Dieter
[Fred Drake]
Nobody should be using the zLOG levels with the logging package, but rather use the logging package levels. So in the end, there's no need for Zope to be defining levels at all, only conventions for how the levels are used.
The logging package supports defining as many additional named levels as you feel like adding, and ZODB added BLATHER and TRACE zLOG-workalike levels at the time ZODB was converted to use the logging package. People may want to restrict themselves to using logging's built-in levels, but logging was designed to be extended in this way, so there's no technical barrier here. In particular, nobody would want to get ZEO's voluminous but micro-purpose TRACE output at debug level.
participants (5)
-
Andreas Jung -
Dieter Maurer -
Florent Guillaume -
Fred Drake -
Tim Peters