basic jython question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gerard Flanagan

    #1

    basic jython question

    Hello all

    I have a 'logger' module which is essentially just a facade over the
    'logging' standard module. Can this be called from jython, and how is
    this acheived? This is a colleague's question but I have no knowledge
    of jython or java, and I can't install them at present in order to
    figure it out.

    It appears that the CPython logging builtin is not implemented in
    Jython, is this correct?

    The source for CPython's logging says that it should work with Python
    >1.5.2, so given everything from Python2.4/Lib/Logging and my own
    facade module, is there any way to get it working from a jython
    script? I presume they just can't be dropped in to a "site-packages"
    directory? I'm completely in the dark, any help?

    Gerard

  • Richard Brodie

    #2
    Re: basic jython question


    "Gerard Flanagan" <grflanagan@yah oo.co.ukwrote in message
    news:1171543539 .339651.319480@ m58g2000cwm.goo glegroups.com.. .
    I have a 'logger' module which is essentially just a facade over the
    'logging' standard module. Can this be called from jython, and how is
    this acheived? This is a colleague's question but I have no knowledge
    of jython or java, and I can't install them at present in order to
    figure it out.
    Since the CPython module is heavily influenced by the native Java logging
    framework (and/or log4j), I would have thought that it would be easier
    to create a Jython wrapper for those.


    Comment

    • Gerard Flanagan

      #3
      Re: basic jython question

      On Feb 15, 1:53 pm, "Richard Brodie" <R.Bro...@rl.ac .ukwrote:
      "Gerard Flanagan" <grflana...@yah oo.co.ukwrote in message
      >
      news:1171543539 .339651.319480@ m58g2000cwm.goo glegroups.com.. .
      >
      I have a 'logger' module which is essentially just a facade over the
      'logging' standard module. Can this be called from jython, and how is
      this acheived? This is a colleague's question but I have no knowledge
      of jython or java, and I can't install them at present in order to
      figure it out.
      >
      Since the CPython module is heavily influenced by the native Java logging
      framework (and/or log4j), I would have thought that it would be easier
      to create a Jython wrapper for those.
      Ok, thanks. I'll suggest that.

      Gerard

      Comment

      • Vinay Sajip

        #4
        Re: basic jython question

        On Feb 15, 1:53 pm, "Richard Brodie" <R.Bro...@rl.ac .ukwrote:
        Since the CPython module is heavily influenced by the native Javalogging
        framework (and/or log4j), I would have thought that it would be easier
        to create a Jython wrapper for those.
        Agreed, but if you copy the logging folder from the CPython Lib folder
        to the jython lib folder, it should work (except for use of other
        modules which wouldn't perhaps be available under Java, such as
        syslog, win32 etc.) - so files, console streams etc. should be OK.

        Clearly, a facade over an existing system such as log4j or
        java.util.loggi ng would have the potential to perform better.

        Regards,

        Vinay Sajip

        Comment

        Working...