On Sun, Apr 1, 2012 at 9:28 PM, Peter Bittner <[email protected]> wrote:
> Third try to ask almost the same question: > > >> 1.) What happens on the import line in library/pyjamas/logging? Does > >> it import the Pyjamas logging module ported by Kees? > >> > >> # blatantly copy everything from CPython's logging > >> from logging import * > >> > >> 2.) Can you compare the two attempts of implementation? > >> (/library/pyjamas/logging/__init__.py, and > >> pyjs/src/pyjs/lib/logging/__init__.py) > >> Is the one in the library path a possible replacement of the one in > pyjs/lib? > > As Pyjamas' logging module in pyjs/src/pyjs/lib/logging/ seems to be a > (more or less) simple copy of Python's (version 2.5?) logging module: > Is copying the code verbatim necessary? Can't we do a "from logging > import *" instead? > > > it shouldn't be there. at all. and needs removing, immediately. > > anything in library/pyjamas/ which has the same names as standard > > http://python.org libraries risks OVERRIDING the standard > > http://python.org libraries. > > I can try to delete the ./library/pyjamas/logging module alltogether, > and come up with logging _handlers_ only (e.g. AlertHandler, > AppendHandler, ConsoleHandler) that can be used with the logging > module in pyjs/src/pyjs/lib/logging. If so, where should I put them? > If I understand correctly, pyjd uses the Python logging module. > Therefore, the Pyjamas logging handlers should go somewhere in > ./library/pyjamas/, correct? > > Peter > I think it's now pretty clear that what Peter is suggesting is the right way forward. Just two points to make: 1. The amendments to pyjs/src/pys/lib/logging/__init__.py which I proposed and provided a diff for are correct and need to be applied. Although I came to my diagnosis by debugging, a comparison of the code with the cPython source of the logging module produces the same conclusion -- the code was wrongly copied. 2. The library/pyjamas/log.py file needs to be preserved in it present form so that KitchenSink and any applications derived from it can run unamended. Phil

