Mercurial > libervia-backend
comparison src/test/test_plugin_xep_0033.py @ 993:301b342c697a
core: use of the new core.log module:
/!\ this is a massive refactoring and was largely automated, it probably did bring some bugs /!\
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 19 Apr 2014 19:19:19 +0200 |
parents | e1842ebcb2f3 |
children | b3f383ab39da |
comparison
equal
deleted
inserted
replaced
992:f51a1895275c | 993:301b342c697a |
---|---|
109 for to_s in [addresses[1], addresses[3], addresses[5]]: | 109 for to_s in [addresses[1], addresses[3], addresses[5]]: |
110 to_jid = JID(to_s) | 110 to_jid = JID(to_s) |
111 host = JID(to_jid.host) | 111 host = JID(to_jid.host) |
112 logger = logging.getLogger() | 112 logger = logging.getLogger() |
113 level = logger.getEffectiveLevel() | 113 level = logger.getEffectiveLevel() |
114 logger.setLevel(logging.ERROR) # remove warning pollution | 114 logger.setLevel(logging.ERROR) # remove log.warning pollution |
115 if self.host.memory.hasServerFeature(plugin.NS_ADDRESS, host, Const.PROFILE[0]): | 115 if self.host.memory.hasServerFeature(plugin.NS_ADDRESS, host, Const.PROFILE[0]): |
116 if host not in cache: | 116 if host not in cache: |
117 sent.append(host) | 117 sent.append(host) |
118 stored.append(host) | 118 stored.append(host) |
119 cache.add(host) | 119 cache.add(host) |
134 @param data: the data to be processed by self.plugin.sendMessageTrigger | 134 @param data: the data to be processed by self.plugin.sendMessageTrigger |
135 @param exception: AbortSendMessage or MessageSentAndStored | 135 @param exception: AbortSendMessage or MessageSentAndStored |
136 """ | 136 """ |
137 logger = logging.getLogger() | 137 logger = logging.getLogger() |
138 level = logger.getEffectiveLevel() | 138 level = logger.getEffectiveLevel() |
139 logger.setLevel(logging.ERROR) # remove warning pollution | 139 logger.setLevel(logging.ERROR) # remove log.warning pollution |
140 pre_treatments = defer.Deferred() | 140 pre_treatments = defer.Deferred() |
141 post_treatments = defer.Deferred() | 141 post_treatments = defer.Deferred() |
142 self.plugin.sendMessageTrigger(data, pre_treatments, post_treatments, Const.PROFILE[0]) | 142 self.plugin.sendMessageTrigger(data, pre_treatments, post_treatments, Const.PROFILE[0]) |
143 post_treatments.callback(data) | 143 post_treatments.callback(data) |
144 logger.setLevel(level) | 144 logger.setLevel(level) |