当前位置: 首页>>代码示例>>Python>>正文


Python log.msg函数代码示例

本文整理汇总了Python中sylk.applications.xmppgateway.logger.log.msg函数的典型用法代码示例。如果您正苦于以下问题:Python msg函数的具体用法?Python msg怎么用?Python msg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了msg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _NH_X2SPresenceHandlerDidEnd

 def _NH_X2SPresenceHandlerDidEnd(self, notification):
     handler = notification.sender
     self.x2s_presence_subscriptions.pop((handler.xmpp_identity.uri, handler.sip_identity.uri), None)
     notification.center.remove_observer(self, sender=handler)
     if XMPPGatewayConfig.log_presence:
         log.msg('Presence flow 0x%x ended %s --> %s' % (id(handler), format_uri(handler.xmpp_identity.uri, 'xmpp'), format_uri(handler.sip_identity.uri, 'sip')))
         log.msg('%d SIP --> XMPP and %d XMPP --> SIP presence flows are active' % (len(self.s2x_presence_subscriptions.keys()), len(self.x2s_presence_subscriptions.keys())))
开发者ID:madhawa,项目名称:sylkserver,代码行数:7,代码来源:__init__.py

示例2: _NH_SIPSessionDidFail

 def _NH_SIPSessionDidFail(self, notification):
     log.msg("SIP session %s failed" % self.sip_session.call_id)
     notification.center.remove_observer(self, sender=self.sip_session)
     notification.center.remove_observer(self, sender=self.msrp_stream)
     self.sip_session = None
     self.msrp_stream = None
     self.end()
开发者ID:madhawa,项目名称:sylkserver,代码行数:7,代码来源:im.py

示例3: _NH_X2SMucInvitationHandlerDidFail

 def _NH_X2SMucInvitationHandlerDidFail(self, notification):
     handler = notification.sender
     sender_uri = handler.sender.uri
     muc_uri = handler.recipient.uri
     participant_uri = handler.participant.uri
     log.msg('%s could not add %s to multiparty chat %s: %s' % (format_uri(sender_uri, 'xmpp'), format_uri(participant_uri), format_uri(muc_uri, 'sip'), notification.data.failure))
     del self.x2s_muc_add_participant_handlers[(muc_uri, participant_uri)]
     notification.center.remove_observer(self, sender=handler)
开发者ID:madhawa,项目名称:sylkserver,代码行数:8,代码来源:__init__.py

示例4: _NH_ChatSessionDidStart

 def _NH_ChatSessionDidStart(self, notification):
     handler = notification.sender
     log.msg("Chat session established sip:%s <--> xmpp:%s" % (handler.sip_identity.uri, handler.xmpp_identity.uri))
     for k, v in self.pending_sessions.items():
         if v is handler:
             del self.pending_sessions[k]
             break
     self.chat_sessions.add(handler)
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:8,代码来源:__init__.py

示例5: _NH_S2XMucInvitationHandlerDidFail

 def _NH_S2XMucInvitationHandlerDidFail(self, notification):
     handler = notification.sender
     muc_uri = handler.sender.uri
     inviter_uri = handler.inviter.uri
     recipient_uri = handler.recipient.uri
     log.msg('%s could not add %s to multiparty chat %s: %s' % (format_uri(inviter_uri, 'sip'), format_uri(recipient_uri, 'xmpp'), format_uri(muc_uri, 'sip'), str(notification.data.failure)))
     del self.s2x_muc_add_participant_handlers[(muc_uri, recipient_uri)]
     notification.center.remove_observer(self, sender=handler)
开发者ID:madhawa,项目名称:sylkserver,代码行数:8,代码来源:__init__.py

示例6: _NH_SIPIncomingSubscriptionDidEnd

 def _NH_SIPIncomingSubscriptionDidEnd(self, notification):
     subscription = notification.sender
     notification.center.remove_observer(self, sender=subscription)
     self._sip_subscriptions.remove(subscription)
     if XMPPGatewayConfig.log_presence:
         log.msg('SIP subscription from %s to %s removed from presence flow 0x%x (%d subs)' % (format_uri(self.sip_identity.uri, 'sip'), format_uri(self.xmpp_identity.uri, 'xmpp'), id(self), len(self._sip_subscriptions)))
     if not self._sip_subscriptions:
         self.end()
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:8,代码来源:presence.py

示例7: incoming_media_session

    def incoming_media_session(self, session):
        if session.remote_identity.uri.host not in self.xmpp_manager.domains | self.xmpp_manager.muc_domains:
            log.msg("Session rejected: From domain is not a local XMPP domain")
            session.reject(403)
            return

        handler = MediaSessionHandler.new_from_sip_session(session)
        if handler is not None:
            NotificationCenter().add_observer(self, sender=handler)
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:9,代码来源:__init__.py

示例8: _NH_X2SMucInvitationHandlerDidStart

 def _NH_X2SMucInvitationHandlerDidStart(self, notification):
     handler = notification.sender
     sender_uri = handler.sender.uri
     muc_uri = handler.recipient.uri
     participant_uri = handler.participant.uri
     log.msg(
         "%s invited %s to multiparty chat %s"
         % (format_uri(sender_uri, "xmpp"), format_uri(participant_uri), format_uri(muc_uri, "sip"))
     )
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:9,代码来源:__init__.py

示例9: _NH_S2XMucInvitationHandlerDidStart

 def _NH_S2XMucInvitationHandlerDidStart(self, notification):
     handler = notification.sender
     muc_uri = handler.sender.uri
     inviter_uri = handler.inviter.uri
     recipient_uri = handler.recipient.uri
     log.msg(
         "%s invited %s to multiparty chat %s"
         % (format_uri(inviter_uri, "sip"), format_uri(recipient_uri, "xmpp"), format_uri(muc_uri, "sip"))
     )
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:9,代码来源:__init__.py

示例10: _NH_SIPIncomingSubscriptionDidTimeout

 def _NH_SIPIncomingSubscriptionDidTimeout(self, notification):
     if XMPPGatewayConfig.log_presence:
         log.msg(
             "SIP subscription from %s to %s timed out for presence flow 0x%x (%d subs)"
             % (
                 format_uri(self.sip_identity.uri, "sip"),
                 format_uri(self.xmpp_identity.uri, "xmpp"),
                 id(self),
                 len(self._sip_subscriptions),
             )
         )
开发者ID:madhawa,项目名称:sylkserver,代码行数:11,代码来源:presence.py

示例11: _NH_SIPIncomingSubscriptionGotUnsubscribe

 def _NH_SIPIncomingSubscriptionGotUnsubscribe(self, notification):
     if XMPPGatewayConfig.log_presence:
         log.msg(
             "SIP subscription from %s to %s was terminated by user for presence flow 1x%x (%d subs)"
             % (
                 format_uri(self.sip_identity.uri, "sip"),
                 format_uri(self.xmpp_identity.uri, "xmpp"),
                 id(self),
                 len(self._sip_subscriptions),
             )
         )
开发者ID:madhawa,项目名称:sylkserver,代码行数:11,代码来源:presence.py

示例12: _NH_S2XMucInvitationHandlerDidEnd

 def _NH_S2XMucInvitationHandlerDidEnd(self, notification):
     handler = notification.sender
     muc_uri = handler.sender.uri
     inviter_uri = handler.inviter.uri
     recipient_uri = handler.recipient.uri
     log.msg(
         "%s added %s to multiparty chat %s"
         % (format_uri(inviter_uri, "sip"), format_uri(recipient_uri, "xmpp"), format_uri(muc_uri, "sip"))
     )
     del self.s2x_muc_add_participant_handlers[(muc_uri, recipient_uri)]
     notification.center.remove_observer(self, sender=handler)
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:11,代码来源:__init__.py

示例13: _NH_ChatSessionDidFail

 def _NH_ChatSessionDidFail(self, notification):
     handler = notification.sender
     uris = None
     for k, v in self.pending_sessions.items():
         if v is handler:
             uris = k
             del self.pending_sessions[k]
             break
     sip_uri, xmpp_uri = uris
     log.msg("Chat session failed sip:%s <--> xmpp:%s (%s)" % (sip_uri, xmpp_uri, notification.data.reason))
     notification.center.remove_observer(self, sender=handler)
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:11,代码来源:__init__.py

示例14: _NH_SIPIncomingSubscriptionNotifyDidFail

 def _NH_SIPIncomingSubscriptionNotifyDidFail(self, notification):
     if XMPPGatewayConfig.log_presence:
         log.msg(
             "Sending SIP NOTIFY failed from %s to %s for presence flow 0x%x: %s (%s)"
             % (
                 format_uri(self.xmpp_identity.uri, "xmpp"),
                 format_uri(self.sip_identity.uri, "sip"),
                 id(self),
                 notification.data.code,
                 notification.data.reason,
             )
         )
开发者ID:madhawa,项目名称:sylkserver,代码行数:12,代码来源:presence.py

示例15: _NH_XMPPSubscriptionGotNotify

 def _NH_XMPPSubscriptionGotNotify(self, notification):
     stanza = notification.data.presence
     self._stanza_cache[stanza.sender.uri] = stanza
     stanza.timestamp = ISOTimestamp.now()    # TODO: mirror the one in the stanza, if present
     pidf_doc = self._build_pidf()
     if XMPPGatewayConfig.log_presence:
         log.msg('XMPP notification from %s to %s for presence flow 0x%x' % (format_uri(self.xmpp_identity.uri, 'xmpp'), format_uri(self.sip_identity.uri, 'sip'), id(self)))
     for subscription in self._sip_subscriptions:
         try:
             subscription.push_content(pidf.PIDFDocument.content_type, pidf_doc)
         except SIPCoreError, e:
             if XMPPGatewayConfig.log_presence:
                 log.msg('Failed to send SIP NOTIFY from %s to %s for presence flow 0x%x: %s' % (format_uri(self.xmpp_identity.uri, 'xmpp'), format_uri(self.sip_identity.uri, 'sip'), id(self), e))
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:13,代码来源:presence.py


注:本文中的sylk.applications.xmppgateway.logger.log.msg函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。