mirror of
https://github.com/carrotquest/django-clickhouse.git
synced 2024-11-22 09:06:43 +03:00
Added request data logging in debug mode
This commit is contained in:
parent
e436ae977b
commit
ab2fe24f74
|
@ -1,3 +1,4 @@
|
||||||
|
import logging
|
||||||
from typing import Generator, Optional, Type, Iterable
|
from typing import Generator, Optional, Type, Iterable
|
||||||
|
|
||||||
from infi.clickhouse_orm.database import Database as InfiDatabase, DatabaseException
|
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 .configuration import config
|
||||||
from .exceptions import DBAliasError
|
from .exceptions import DBAliasError
|
||||||
|
|
||||||
|
logger = logging.getLogger('django-clickhouse')
|
||||||
|
|
||||||
|
|
||||||
class Database(InfiDatabase):
|
class Database(InfiDatabase):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
|
@ -119,6 +122,7 @@ class Database(InfiDatabase):
|
||||||
# For testing purposes
|
# For testing purposes
|
||||||
for data in gen():
|
for data in gen():
|
||||||
with statsd.timer(statsd_key):
|
with statsd.timer(statsd_key):
|
||||||
|
logger.debug('django-clickhouse: insert tuple: %s' % data)
|
||||||
self._send(data)
|
self._send(data)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user