From ab2fe24f741065806758dd32f9c0fc919e737bf5 Mon Sep 17 00:00:00 2001 From: M1ha Date: Fri, 15 Feb 2019 15:52:16 +0500 Subject: [PATCH] Added request data logging in debug mode --- src/django_clickhouse/database.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/django_clickhouse/database.py b/src/django_clickhouse/database.py index aa0e8b2..c384435 100644 --- a/src/django_clickhouse/database.py +++ b/src/django_clickhouse/database.py @@ -1,3 +1,4 @@ +import logging from typing import Generator, Optional, Type, Iterable from infi.clickhouse_orm.database import Database as InfiDatabase, DatabaseException @@ -9,6 +10,8 @@ from statsd.defaults.django import statsd from .configuration import config from .exceptions import DBAliasError +logger = logging.getLogger('django-clickhouse') + class Database(InfiDatabase): def __init__(self, **kwargs): @@ -119,6 +122,7 @@ class Database(InfiDatabase): # For testing purposes for data in gen(): with statsd.timer(statsd_key): + logger.debug('django-clickhouse: insert tuple: %s' % data) self._send(data)