mirror of
https://github.com/carrotquest/django-clickhouse.git
synced 2024-11-22 00:56:37 +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 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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user