From fb0649e4fc0cde484ad33182fa5680763c85f143 Mon Sep 17 00:00:00 2001 From: "aleksandr.tretyakov" Date: Wed, 4 Oct 2023 18:30:47 +0200 Subject: [PATCH] Add ClickHouse 'Test' log level support. ref: https://github.com/ClickHouse/ClickHouse/pull/28559 fixes: #383 --- clickhouse_driver/log.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clickhouse_driver/log.py b/clickhouse_driver/log.py index 6831238d..4f7b3543 100644 --- a/clickhouse_driver/log.py +++ b/clickhouse_driver/log.py @@ -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', @@ -12,7 +13,8 @@ 'Notice', 'Information', 'Debug', - 'Trace' + 'Trace', + 'Test', ) @@ -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]