Пример #1
0
    def dispatch_logging_event(self, logging_event):
        """
        Send `logging_event` to all configured loggers.

        Uses the instance management code from parent class
        :class:`~common.abstract_service_manager.AbstractServiceManager`
        to find and send the logging event passed in as an argument to
        each logger configured in the settings file.  Valid logging
        events are defined in module
        :mod:`~channels.logging.logging_events`.

        In normal operation, this method will be called automatically
        in the system by the
        :class:`~channels.channel_publisher.ChannelPublisher`, and it
        should not be necessary to use it directly.

        """
        if not isinstance(logging_event, LoggingEventBase):
            raise TypeError, "LoggingManager: logging_event TypeError"

        for name in AbstractServiceManager.instance_list(self):
            logger_instance = AbstractServiceManager.instance_get(self, name)
            try:
                logger_instance.log_event(logging_event)
            except Exception, e:
                self.__tracer.error("exception during log_event dispatch: %s",
                                    str(e))
                self.__tracer.debug(traceback.format_exc())
Пример #2
0
    def dispatch_logging_event(self, logging_event):
        """
        Send `logging_event` to all configured loggers.

        Uses the instance management code from parent class
        :class:`~common.abstract_service_manager.AbstractServiceManager`
        to find and send the logging event passed in as an argument to
        each logger configured in the settings file.  Valid logging
        events are defined in module
        :mod:`~channels.logging.logging_events`.

        In normal operation, this method will be called automatically
        in the system by the
        :class:`~channels.channel_publisher.ChannelPublisher`, and it
        should not be necessary to use it directly.

        """
        if not isinstance(logging_event, LoggingEventBase):
            raise TypeError, "LoggingManager: logging_event TypeError"

        for name in AbstractServiceManager.instance_list(self):
            logger_instance = AbstractServiceManager.instance_get(self, name)
            try:
                logger_instance.log_event(logging_event)
            except Exception, e:
                self.__tracer.error("exception during log_event dispatch: %s",
                                    str(e))
                self.__tracer.debug(traceback.format_exc())
    def instance_get(self, instancename):
        """Internal method to find a given driver instance."""
	return AbstractServiceManager.instance_get(self, instancename)
 def driver_get(self, name):
     
     return AbstractServiceManager.instance_get(self, name)