Exemplo n.º 1
0
    def start(self, application):
        txlog.msg("Starting GLBackend on %s (%s UTC)" %  (gltime.prettyDateNow(),
                                                        gltime.utcPrettyDateNow()))
        logging.basicConfig()
        python_logging = txlog.PythonLoggingObserver()
        if config.advanced.debug:
            python_logging.logger.setLevel(logging.DEBUG)
        else:
            python_logging.logger.setLevel(logging.INFO)

        txlog.startLoggingWithObserver(python_logging.emit)

        txlog.addObserver(txlog.FileLogObserver(daily_logfile).emit)
Exemplo n.º 2
0
        interact with globaleaks, so, keep sharing! ;)
        """
        log.debug("[D] %s %s " % (__file__, __name__), "Class ReceiverTip", "receiver_get_single", tip_gus)

        store = self.getStore('receiver_get_single')

        try:
            requested_t = store.find(ReceiverTip, ReceiverTip.tip_gus == tip_gus).one()
        except NotOneError, e:
            store.close()
            raise TipGusNotFound
        if not requested_t:
            store.close()
            raise TipGusNotFound

        requested_t.last_activity = gltime.utcPrettyDateNow()
        store.commit()

        tip_details = requested_t.internaltip._description_dict()

        # Those elements are overrided by others API
        #receivers_info = requested_t.internaltip._receivers_description()
        #tip_info = requested_t._description_dict()
        #ret_dict = { 'tip_details' : tip_details, 'tip_info' : tip_info, 'receivers_info' : receivers_info }

        # need to return tip_gus too
        tip_details.update({ 'id' : requested_t.tip_gus })
        store.close()

        return tip_details