Re: [Zope3-dev] Re: [Zope-dev] zLOG is dead
Barry Warsaw wrote: AFAIK, the online logging package docs are about it. That's not the easiest way to learn how to use the package unfortunately. *sigh* What is the easiest way then? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope3-dev] Re: [Zope-dev] zLOG is dead
On Tue, 2004-04-20 at 10:01, Chris Withers wrote: > This discussion smells like that string should be computed from introspection. > > Why can't it be computed from introspecting whatever code called the log method? You probably could do it via sys._getframe(). I'm not sure you should though. ;) > (btw, is there an intro to Python's logger stuff? looks like I need to get up to > speed on this...) AFAIK, the online logging package docs are about it. That's not the easiest way to learn how to use the package unfortunately. -Barry ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope-dev] zLOG is dead
From: "Chris Withers" <[EMAIL PROTECTED]> > This discussion smells like that string should be computed from introspection. > > Why can't it be computed from introspecting whatever code called the log method? Well, first of all, how? __name__ should always be available, but that is the name of the file that you are in. That's not what you want to log. And most seem to prefer using Zope.MailHost instead of Products.MailHost to notify that it's a part of the standard Zope distro, which won't be possible. And then again you might want to override it for many different reasons. __name__ could be the default, though, I guess. ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope-dev] zLOG is dead
Lennart Regebro wrote: Yeah, but is it reasonable to think that people who write new products will do this? A rule that most people will break is a bad rule... That people working on Zope itself can be well versed enough to use Zope. for things in teh Zope repository seems reasonable. But will people working on Plone really use "Zope.CMFQuickInstaller"? Rather they will probably say just "CMFQuickInstaller", "CMF.QuickInstaller" och "Plone.QuickInstaller" or something. This discussion smells like that string should be computed from introspection. Why can't it be computed from introspecting whatever code called the log method? (btw, is there an intro to Python's logger stuff? looks like I need to get up to speed on this...) Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope-dev] zLOG is dead
[Chris McDonough] > There probably are no log-trawling tools. The output generated by zLOG > is basically unparseable. Alas, that hasn't stopped people from writing trawlers to analyze ZEO server and client logs. That one's going to be my headache "to fix"(*), and has some urgency since ZODB/ZEO's use of zLOG is the only reason Zope3 still needs the zLOG package. people-who-like-regexps-don't-understand-"perverse"-ly y'rs - tim (*) Unless someone decides to do it before I get to it. False hope is a way of life . ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope-dev] zLOG is dead
On Wed, 2004-04-14 at 18:53, Fred Drake wrote: > Keeping it simple is good, but I'd still like to see every logging subsystem > in code that ships with the Zope 2 core start with "Zope." This is a > potential backwards compatibility issue, though, since log-trawling tools are > already using the names currently generated, as inconsistent as they are. There probably are no log-trawling tools. The output generated by zLOG is basically unparseable. - C ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope-dev] zLOG is dead
On Wednesday 14 April 2004 10:45 am, Andreas Jung wrote: > For consitency: Zope.Products. > For lazy writers: Zope. X > > I prefer the second solution...everyone should know what are products and > what > are packages. In fact the name does not matter because you can see in the > traceback > where the error occurs. You don't get this information from the name > directly. I disagree. Not everyone that looks at the logs will be a site developer or Zope product or core developer. Keeping things explicit is reasonable. > Keep the product name as it is...means Products/ should use > Zope. as logger name. No need to introduce a new mapping. Keep it > simple. Keeping it simple is good, but I'd still like to see every logging subsystem in code that ships with the Zope 2 core start with "Zope." This is a potential backwards compatibility issue, though, since log-trawling tools are already using the names currently generated, as inconsistent as they are. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope-dev] zLOG is dead
On Wednesday 14 April 2004 11:44 am, Lennart Regebro wrote: > Yeah, but is it reasonable to think that people who write new products > will do this? A rule that most people will break is a bad rule... That > people working on Zope itself can be well versed enough to use Zope. > for things in teh Zope repository seems reasonable. But will people > working on Plone really use "Zope.CMFQuickInstaller"? Rather they will > probably say just "CMFQuickInstaller", "CMF.QuickInstaller" och > "Plone.QuickInstaller" or something. I would only expect any sort of leading "Zope." to apply to the software that ships as part of Zope 2. Other products and tools, like the CMF and Plone, should use a different prefix ("CMF." and "Plone." come to mind as reasonable candidates). -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope-dev] zLOG is dead
From: "Andreas Jung" <[EMAIL PROTECTED]> > Keep the product name as it is...means Products/ should use > Zope. as logger name. No need to introduce a new mapping. Keep it > simple. Yeah, but is it reasonable to think that people who write new products will do this? A rule that most people will break is a bad rule... That people working on Zope itself can be well versed enough to use Zope. for things in teh Zope repository seems reasonable. But will people working on Plone really use "Zope.CMFQuickInstaller"? Rather they will probably say just "CMFQuickInstaller", "CMF.QuickInstaller" och "Plone.QuickInstaller" or something. As with all management, people will do what seems natural to them, unless it doesn't work. There is no incentive to stick a "Zope." at the front, so I don't think people will. Besides, there is a benefit in not doing it, because then you can see what is a part of Zope and what is add-ons. ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope3-dev] Re: [Zope-dev] zLOG is dead
--On Mittwoch, 14. April 2004 16:45 Uhr +0200 Andreas Jung <[EMAIL PROTECTED]> wrote: --On Mittwoch, 14. April 2004 10:57 Uhr +0200 Lennart Regebro <[EMAIL PROTECTED]> wrote: From: "Andreas Jung" <[EMAIL PROTECTED]> When I look through the Zope HEAD code then you are using e.g. 'zodb.conn' or 'zodb.storage' but also 'Zope' as loggername. Do we have to agree on some common usage of the logger names? E.g. for logging calls in the reST packagebetter using 'Zope' or 'reST'? 'reST' I guess is the onbious one. I would like to see something like this: For Zope core core: Zope.subsystem. i.e. 'Zope.Accesscontrol', 'Zope.OFS'. +1 For the default lib/python/Product stuff: Either Zope.Product or just Product, ie 'MailHost' or 'Zope.MailHost'. Which I don't care, makes no matter for me, but consistency would be good. For consitency: Zope.Products. For lazy writers: Zope. X I prefer the second solution...everyone should know what are products and what are packages. In fact the name does not matter because you can see in the traceback where the error occurs. You don't get this information from the name directly. Of course this applies only if you have an error :-) Anywaynames should be kept as short as possible. -aj ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope-dev] zLOG is dead
--On Mittwoch, 14. April 2004 10:57 Uhr +0200 Lennart Regebro <[EMAIL PROTECTED]> wrote: From: "Andreas Jung" <[EMAIL PROTECTED]> When I look through the Zope HEAD code then you are using e.g. 'zodb.conn' or 'zodb.storage' but also 'Zope' as loggername. Do we have to agree on some common usage of the logger names? E.g. for logging calls in the reST packagebetter using 'Zope' or 'reST'? 'reST' I guess is the onbious one. I would like to see something like this: For Zope core core: Zope.subsystem. i.e. 'Zope.Accesscontrol', 'Zope.OFS'. +1 For the default lib/python/Product stuff: Either Zope.Product or just Product, ie 'MailHost' or 'Zope.MailHost'. Which I don't care, makes no matter for me, but consistency would be good. For consitency: Zope.Products. For lazy writers: Zope. X I prefer the second solution...everyone should know what are products and what are packages. In fact the name does not matter because you can see in the traceback where the error occurs. You don't get this information from the name directly. For other Products: Just the product name. In the case of CMF and CPS and other things, you could possibly decide to use 'CMF.Core' and 'CMF.Default' instead of 'CMFCore' and 'CMFDefault' by that also seems kinda silly. Keep the product name as it is...means Products/ should use Zope. as logger name. No need to introduce a new mapping. Keep it simple. -aj ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope-dev] zLOG is dead
From: "Andreas Jung" <[EMAIL PROTECTED]> > When I look through the Zope HEAD code then you are using e.g. > 'zodb.conn' or 'zodb.storage' but also 'Zope' as loggername. Do we > have to agree on some common usage of the logger names? > E.g. for logging calls in the reST packagebetter using 'Zope' or 'reST'? 'reST' I guess is the onbious one. I would like to see something like this: For Zope core core: Zope.subsystem. i.e. 'Zope.Accesscontrol', 'Zope.OFS'. For the default lib/python/Product stuff: Either Zope.Product or just Product, ie 'MailHost' or 'Zope.MailHost'. Which I don't care, makes no matter for me, but consistency would be good. For other Products: Just the product name. In the case of CMF and CPS and other things, you could possibly decide to use 'CMF.Core' and 'CMF.Default' instead of 'CMFCore' and 'CMFDefault' by that also seems kinda silly. Right? //Lennart ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope-dev] zLOG is dead
On Wednesday 14 April 2004 01:49 am, Andreas Jung wrote: > What is the recommend way to migrate existing code? > > I assume using: > > import logging > logger = logging.getLogger(loggername). That works, and certainly matches what I've been doing, and what we see in the Zope 3 codebase as well. > When I look through the Zope HEAD code then you are using e.g. > 'zodb.conn' or 'zodb.storage' but also 'Zope' as loggername. Do we > have to agree on some common usage of the logger names? > E.g. for logging calls in the reST packagebetter using 'Zope' or > 'reST'? I don't think there is a general convention at this time; where I've switched things over (only a few places), I've used what was being passed to zLOG.LOG as the subsystem parameter. Where there's no precedent... I don't know. A guiding convention would be nice; I could see using the package name if there's nothing else that sticks out as obvious. That doesn't match a lot of the existing usage, though. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: [Zope-dev] zLOG is dead
+1 What is the recommend way to migrate existing code? I assume using: import logging logger = logging.getLogger(loggername). When I look through the Zope HEAD code then you are using e.g. 'zodb.conn' or 'zodb.storage' but also 'Zope' as loggername. Do we have to agree on some common usage of the logger names? E.g. for logging calls in the reST packagebetter using 'Zope' or 'reST'? -aj --On Dienstag, 13. April 2004 15:53 Uhr -0400 Fred Drake <[EMAIL PROTECTED]> wrote: zLOG is dead The zLOG package used for logging throughout ZODB, ZEO, and Zope 2 has been declared obsolete. All logging for Zope products will use the logging package from Python's standard library. The zLOG package still exists in Zope 2 and the separate package for ZODB, but it is now an API shim (or "façade") over the logging package. It is expected to wither away to nothing at some point. Why should you care? This means that the environment variables EVENT_LOG_FILE, EVENT_LOG_SEVERITY, STUPID_LOG_FILE, STUPID_LOG_SEVERITY, and ZSYSLOG are no longer honored for Zope 2.8, ZODB, or ZEO. Zope 2 reads logging configuring from the zope.conf configuration file, and the test.py script for developers reads a log.ini file using the obnoxious configuration syntax provided by the logging package itself. If you use the ZODB distribution but not the rest of Zope, you probably want to start changing any of your code that uses zLOG to use the logging package. ZODB and ZEO will be changed to use the logging package directly as well to avoid dependence on the API shim. How can you help? - If you have some time to contribute to Zope development, the removal of zLOG calls from the ZODB and ZEO packages would be a welcome contribution. I've converted Signals/Signals.py and Zope/Startup/__init__.py, and some modules of ZODB and ZEO already use the logging package directly; these can serve as examples. -Fred ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )