'Emit a log event to all log observers at the given level.
@param level: a L{LogLevel}
@param format: a message format using new-style (PEP 3101)
formatting.  The logging event (which is a L{dict}) is
used to render this format string.
@param kwargs: additional key/value pairs to include in the event.
Note that values which are later mutated may result in
non-deterministic behavior from observers that schedule work for
later execution.'

def emit(self, level, format=None, **kwargs):

    if (level not in LogLevel.iterconstants()):
        self.failure('Got    invalid    log    level    {invalidLevel!r}    in    {logger}.emit().', Failure(InvalidLogLevelError(level)), invalidLevel=level, logger=self)
        return
    event = kwargs
    event.update(log_logger=self, log_level=level, log_namespace=self.namespace, log_source=self.source, log_format=format, log_time=time())
    if ('log_trace' in event):
        event['log_trace'].append((self, self.observer))
    self.observer(event)
