Ticket #638: log.py.patch

File log.py.patch, 955 bytes (added by harshaw, 11 years ago)

log.py patch (for the interface)

  • log.py

     
    2020except NameError:
    2121    UnicodeEncodeError = UnicodeError
    2222
     23#for ILogObserver
     24from zope.interface import Interface
    2325
    2426class ILogContext:
    2527    """Actually, this interface is just a synoym for the dictionary interface,
     
    237239    msg = theLogPublisher.msg
    238240
    239241
     242class ILogObserver(Interface):
     243
     244    def setFile(self,f):
     245        """ set the file like object used for writing """
     246   
     247    def emit(self, eventDict):
     248        """
     249        emit a log message.
     250        """
     251       
     252    def start(self):
     253        """Start observing log events."""
     254
     255    def stop(self):
     256        """Stop observing log events."""
     257
     258    def __repr__(self):
     259        """ print out what this log observer is all about """
     260
    240261class FileLogObserver:
    241262    """Log observer that writes to a file-like object.
    242263