Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2020-03-20 17:51:17 +0300
committerlovetox <philipp@hoerist.com>2020-03-20 17:51:17 +0300
commit5cc8dca3126365ac2dd2296060d516814781f606 (patch)
tree09a5b05a961452a5b7b4a3c3128ec4f671f75912 /nbxmpp/modules/receipts.py
parent0c7293b8bb01f16a717e736727d7bcad4f888d57 (diff)
Logging: Add context to logging output
Diffstat (limited to 'nbxmpp/modules/receipts.py')
-rw-r--r--nbxmpp/modules/receipts.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/nbxmpp/modules/receipts.py b/nbxmpp/modules/receipts.py
index 2056efe..676e9ad 100644
--- a/nbxmpp/modules/receipts.py
+++ b/nbxmpp/modules/receipts.py
@@ -15,8 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program; If not, see <http://www.gnu.org/licenses/>.
-import logging
-
from nbxmpp.protocol import NS_RECEIPTS
from nbxmpp.protocol import NS_MUC_USER
from nbxmpp.protocol import isMucPM
@@ -24,12 +22,13 @@ from nbxmpp.protocol import Message
from nbxmpp.structs import StanzaHandler
from nbxmpp.structs import ReceiptData
from nbxmpp.util import generate_id
-
-log = logging.getLogger('nbxmpp.m.receipts')
+from nbxmpp.modules.base import BaseModule
-class Receipts:
+class Receipts(BaseModule):
def __init__(self, client):
+ BaseModule.__init__(self, client)
+
self._client = client
self.handlers = [
StanzaHandler(name='message',
@@ -48,8 +47,8 @@ class Receipts:
if received is not None:
id_ = received.getAttr('id')
if id_ is None:
- log.warning('Receipt without id attr')
- log.warning(stanza)
+ self._log.warning('Receipt without id attr')
+ self._log.warning(stanza)
return
properties.receipt = ReceiptData(received.getName(), id_)