Skip to content

Commit

Permalink
Merge pull request #395 from the-horhe/logging_fix
Browse files Browse the repository at this point in the history
Add ClickHouse 'Test' log level support.
  • Loading branch information
xzkostyan authored Oct 5, 2023
2 parents 41ba852 + fb0649e commit 6dd3ae5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions clickhouse_driver/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

logger = logging.getLogger(__name__)


# Keep in sync with ClickHouse priorities
# https://github.com/ClickHouse/ClickHouse/blob/master/src/Interpreters/InternalTextLogsQueue.cpp
log_priorities = (
'Unknown',
'Fatal',
Expand All @@ -12,7 +13,8 @@
'Notice',
'Information',
'Debug',
'Trace'
'Trace',
'Test',
)


Expand All @@ -25,7 +27,7 @@ def log_block(block):
for row in block.get_rows():
row = dict(zip(column_names, row))

if 1 <= row['priority'] <= 8:
if 1 <= row['priority'] <= 9:
priority = log_priorities[row['priority']]
else:
priority = row[0]
Expand Down

0 comments on commit 6dd3ae5

Please sign in to comment.