Re: [ZODB-Dev] Re: [Zope-dev] Re: zLOG module deprecated
Andreas Jung wrote at 2006-1-10 11:23 +0100: > ... >Do we need one for Zope 2 and Zope 3? I think what we discussed during breakfast would be optimal: To configure the Python logger such that: * it supports additional (Zope2/3 standard!) log levels * displays Zope tracebacks rather than the much less informative Python tracebacks Application code could then use "from logging import getLogger" and use the obtained logger module in the normal way. -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [ZODB-Dev] Re: [Zope-dev] Re: zLOG module deprecated
[Andreas Jung] > ... > Obviously ZEO (using TRACE) runs on Zope 3 without zLOG so specific > extension can be handled locally. ZEO also runs on Zopes 2.8 and 2.9 without zLOG -- zLOG hasn't been used in ZODB since 3.2 (ZODBs 3.3, 3.4, 3.5, 3.6, and current trunk contain no references to zLOG). If Zope folk generally want more than the 5 logging levels that come built in to Python's logging module, that's easy to supply, but then it's also important that they define them with the same names and numeric values. ZODB's loglevels.py does so, and is the only "extension" to Python's logging module ZODB made. This is the code in its entirety (but skipping the copyright boilerplate at the top -- Copyright (c) 2004 Zope Corporation and Contributors): """ import logging __all__ = ["BLATHER", "TRACE"] # In the days of zLOG, there were 7 standard log levels, and ZODB/ZEO used # all of them. Here's how they map to the logging package's 5 standard # levels: # #zLOG logging #---- #PANIC (300) FATAL, CRITICAL (50) #ERROR (200) ERROR (40) #WARNING, PROBLEM (100) WARN (30) #INFO (0) INFO (20) #BLATHER (-100) none -- defined here as BLATHER (15) #DEBUG (-200) DEBUG (10) #TRACE (-300) none -- defined here as TRACE (5) # # TRACE is used by ZEO for extremely verbose trace output, enabled only # when chasing bottom-level communications bugs. It really should be at # a lower level than DEBUG. # # BLATHER is a harder call, and various instances could probably be folded # into INFO or DEBUG without real harm. BLATHER = 15 TRACE = 5 logging.addLevelName("BLATHER", BLATHER) logging.addLevelName("TRACE", TRACE) """ When ZODB wants to use BLATHER or TRACE, it imports the symbolic name from ZODB.loglevels instead of from logging. That's all there is to it -- it's trivial. If Zope decided to keep BLATHER and TRACE too, then a future ZODB release would presumably change to import BLATHER and TRACE from the same place Zope gets them. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [ZODB-Dev] Re: [Zope-dev] Re: zLOG module deprecated
--On 10. Januar 2006 12:20:14 +0100 Lennart Regebro <[EMAIL PROTECTED]> wrote: On 1/10/06, Andreas Jung <[EMAIL PROTECTED]> wrote: This means basically keeping zLOG since it is only a very thin logging module wrapper. So why did we deprecate zLOG? :-) Did we? It was implemented as a wrapper in 2.8, but wasn't officially deprecated until last week. ;-) Right, with the intention to get rid of zLOG at some point in the future (from my memory). I still have no opinion on the actual issue. I know what I want, but if it has too many drawbacks, I don't want it. :-) Something common between Zope3 and Zope2 would probably be a good idea. That would be the way to go. But I still have my doubts. Zope 3 obviously does not need a dedicated logging module, why does Zope 2 need one? Obviously ZEO (using TRACE) runs on Zope 3 without zLOG so specific extension can be handled locally. To bring this discussion to an end: - if we need specific logging functionaliy then it should be implemented to be shared between Zope 2 and Zope 3 - adjusting the current code base from 'logging' to zope.logging would mean just to replace the imports (assuming we keep getLogger() factory) I am not totally against something like zope.logging but I still don't see the real need. We have some months until Zope 2.10 to get this in the right way. -aj pgpxWnf4mNHsh.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [ZODB-Dev] Re: [Zope-dev] Re: zLOG module deprecated
On 1/10/06, Andreas Jung <[EMAIL PROTECTED]> wrote: > This means basically keeping zLOG since it is only a very thin logging > module wrapper. So why did we deprecate zLOG? :-) Did we? It was implemented as a wrapper in 2.8, but wasn't officially deprecated until last week. ;-) I still have no opinion on the actual issue. I know what I want, but if it has too many drawbacks, I don't want it. :-) Something common between Zope3 and Zope2 would probably be a good idea. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [ZODB-Dev] Re: [Zope-dev] Re: zLOG module deprecated
--On 10. Januar 2006 11:44:31 +0100 Lennart Regebro <[EMAIL PROTECTED]> wrote: I don't have an opinion on solution yet. What I want is something easy to use wher you can just import a log method or object and make a function. I don't want to set things up, because if we need to set things up, everybody will set things up differently, which is not a good idea. This means basically keeping zLOG since it is only a very thin logging module wrapper. So why did we deprecate zLOG? :-) -aj pgpJATjBQBqCx.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [ZODB-Dev] Re: [Zope-dev] Re: zLOG module deprecated
On 1/10/06, Andreas Jung <[EMAIL PROTECTED]> wrote: > I don't read anything about using old log levels for new code. And neither do I read anything about NOT using them. So, your statement that the decision was taken in 2.8 is false. That renders the last posts pointless, and we are back at my first post about the levels today. > Independent of the different interpretations: what is your suggestion? I don't have an opinion on solution yet. What I want is something easy to use wher you can just import a log method or object and make a function. I don't want to set things up, because if we need to set things up, everybody will set things up differently, which is not a good idea. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [ZODB-Dev] Re: [Zope-dev] Re: zLOG module deprecated
--On 10. Januar 2006 11:09:32 +0100 Lennart Regebro <[EMAIL PROTECTED]> wrote: On 1/10/06, Andreas Jung <[EMAIL PROTECTED]> wrote: This decision was made for Zope 2.8 (according to zLOG/__init__.py). How do you mean? As far as I can see, all the levels are still there in zLOG py. The question now is weather two of these levels should be removed, as I understand it because you don't understand why other people use them. I find that logic difficult to understand. """ This module exists only for backward compatibility. Any new code for Zope 2.8 and newer should use the logging module from Python's standard library directly. zLOG is only an API shim to map existing use of zLOG onto the standard logging API. """ I don't read anything about using old log levels for new code. I read this as: use the Python logging module and if you need something special then implement it on your own. That's my interpretation. Independent of the different interpretations: what is your suggestion? Leave the zLOG in place? Leave something else in place? Do we need common Zope logger architecture? Do we need one for Zope 2 and Zope 3? I still not getting the point why you can't use the logging module and extend if needed inside your application or module? -aj pgp1TG221g1nM.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [ZODB-Dev] Re: [Zope-dev] Re: zLOG module deprecated
On 1/10/06, Andreas Jung <[EMAIL PROTECTED]> wrote: > This decision was made for Zope 2.8 (according to zLOG/__init__.py). How do you mean? As far as I can see, all the levels are still there in zLOG py. The question now is weather two of these levels should be removed, as I understand it because you don't understand why other people use them. I find that logic difficult to understand. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [ZODB-Dev] Re: [Zope-dev] Re: zLOG module deprecated
--On 10. Januar 2006 10:51:04 +0100 Lennart Regebro <[EMAIL PROTECTED]> wrote: I find all this fairly self-evident and highly useful, and se absolutely zero reason for removing them, when they are so useful. This decision was made for Zope 2.8 (according to zLOG/__init__.py). We're now working on Zope 2.10. What is the problem adding these levels in your application if needed? Also Zope 3 is not using a dedicated z3LOG module or whatever. I still don't see the need for one. If there is need for one then this should be solved as common solution for Zope 3 and Zope 2. -aj pgpqaOU4a7KT2.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [ZODB-Dev] Re: [Zope-dev] Re: zLOG module deprecated
On 1/9/06, Andreas Jung <[EMAIL PROTECTED]> wrote: > I've never had the need to use them. No, but other people do. > 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. But I can, and so can Florent. "PROBLEM" I agree about. I have never heard that one before, and I don't see why you can't use ERROR or WARNING. ERROR: Something didn't work. WARNING: There is something fishy here, I'm guessing how it should be handled. INFO: Nothing is wrong, but this is important. (For example Zope server ready to handle requests). VERBOSE: Nothing is wrong and this may be important. (For example the info saying what IP-adress and port the zope server is started on.) DEBUG: For debug information. TRACE: I need to have a lot of information now! I find all this fairly self-evident and highly useful, and se absolutely zero reason for removing them, when they are so useful. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )