Did I find the right examples for you? yes no

All Samples(77)  |  Call(58)  |  Derive(0)  |  Import(19)
Extract text from an event dict passed to a log observer. If it cannot
handle the dict, it returns None.

The possible keys of eventDict are:
 - C{message}: by default, it holds the final text. It's required, but can
   be empty if either C{isError} or C{format} is provided (the first
   having the priority).
 - C{isError}: boolean indicating the nature of the event.
 - C{failure}: L{failure.Failure} instance, required if the event is an
   error.(more...)

        def textFromEventDict(eventDict):
    """
    Extract text from an event dict passed to a log observer. If it cannot
    handle the dict, it returns None.

    The possible keys of eventDict are:
     - C{message}: by default, it holds the final text. It's required, but can
       be empty if either C{isError} or C{format} is provided (the first
       having the priority).
     - C{isError}: boolean indicating the nature of the event.
     - C{failure}: L{failure.Failure} instance, required if the event is an
       error.
     - C{why}: if defined, used as header of the traceback in case of errors.
     - C{format}: string format used in place of C{message} to customize
       the event. It uses all keys present in C{eventDict} to format
       the text.
    Other keys will be used when applying the C{format}, or ignored.
    """
    edm = eventDict['message']
    if not edm:
        if eventDict['isError'] and 'failure' in eventDict:
            text = ((eventDict.get('why') or 'Unhandled Error')
                    + '\n' + eventDict['failure'].getTraceback())
        elif 'format' in eventDict:
            text = _safeFormat(eventDict['format'], eventDict)
        else:
            # we don't know how to log this
            return
    else:
        text = ' '.join(map(reflect.safe_str, edm))
    return text
        


src/n/o/nodeset.core-HEAD/src/nodeset/common/log.py   nodeset.core(Download)
    def emit(self, eventDict):
        text = log.textFromEventDict(eventDict)
 
        if text is None:
            return
    def emit(self, eventDict):
        text = log.textFromEventDict(eventDict)
 
        lvl = eventDict.get('logLevel')
 

src/t/w/TwistedBot-HEAD/twistedbot/logbot.py   TwistedBot(Download)
        if "header" not in eventDict:
            return
        text = log.textFromEventDict(eventDict)
        if text is None:
            return

src/c/r/crossbar-HEAD/crossbar/crossbar/twisted/process.py   crossbar(Download)
from twisted.python import util
from twisted.python import log
from twisted.python.log import FileLogObserver, textFromEventDict
 
from twisted.internet.endpoints import _WrapIProtocol, ProcessEndpoint
   def emit(self, eventDict):
      text = textFromEventDict(eventDict)
      if text:
         util.untilConcludes(self.write, text + "\n")
         util.untilConcludes(self.flush)

src/o/o/ooniprobe-1.0.1/ooni/utils/log.py   ooniprobe(Download)
    def emit(self, eventDict):
        text = txlog.textFromEventDict(eventDict)
        if text is None:
            return
 

src/g/r/graphite-HEAD/carbon/lib/carbon/log.py   graphite(Download)
import time
from sys import stdout, stderr
from zope.interface import implements
from twisted.python.log import startLoggingWithObserver, textFromEventDict, msg, err, ILogObserver
from twisted.python.syslog import SyslogObserver
def formatEvent(event, includeType=False):
  event['isError'] = 'failure' in event
  message = textFromEventDict(event)
 
  if includeType:

src/c/a/carbon-0.9.12/lib/carbon/log.py   carbon(Download)
import time
from os.path import exists
from sys import stdout, stderr
from zope.interface import implements
from twisted.python.log import startLoggingWithObserver, textFromEventDict, msg, err, ILogObserver
def formatEvent(event, includeType=False):
  event['isError'] = 'failure' in event
  message = textFromEventDict(event)
 
  if includeType:

src/t/w/twisted-lock-HEAD/lock/utils.py   twisted-lock(Download)
 
from functools import wraps
from twisted.python.log import textFromEventDict, addObserver, removeObserver
from twisted.internet.defer import Deferred
from twisted.internet import reactor
            level = logbook.INFO
 
        text = textFromEventDict(event_dict)
        if text is None:
            return

src/c/a/carbon-HEAD/lib/carbon/log.py   carbon(Download)
import time
from sys import stdout, stderr
from zope.interface import implements
from twisted.python.log import startLoggingWithObserver, textFromEventDict, msg, err, ILogObserver
from twisted.python.syslog import SyslogObserver
def formatEvent(event, includeType=False):
  event['isError'] = 'failure' in event
  message = textFromEventDict(event)
 
  if includeType:

src/c/r/crossbar-0.9.3/crossbar/twisted/process.py   crossbar(Download)
from twisted.python import util
from twisted.python import log
from twisted.python.log import FileLogObserver, textFromEventDict
 
from twisted.internet.endpoints import _WrapIProtocol, ProcessEndpoint
   def emit(self, eventDict):
      text = textFromEventDict(eventDict)
      if text:
         util.untilConcludes(self.write, text + "\n")
         util.untilConcludes(self.flush)

src/p/u/pushproxy-HEAD/src/icl0ud/logger.py   pushproxy(Download)
    def emit(self, eventDict):
        text = log.textFromEventDict(eventDict)
        if text is None:
            text = '<no text>'
 

  1 | 2 | 3 | 4 | 5 | 6  Next