Skip to content

Commit 3e6f1ea

Browse files
chore(deps): lock file maintenance (#1051)
1 parent f739c77 commit 3e6f1ea

3 files changed

Lines changed: 1553 additions & 1455 deletions

File tree

‎src/apify_client/_streamed_log.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from asyncio import Task
88
from datetime import UTC, datetime
99
from threading import Thread
10-
from typing import TYPE_CHECKING, ClassVar, Self, cast
10+
from typing import TYPE_CHECKING, ClassVar, Self
1111

1212
from apify_client._docs import docs_group
1313

@@ -79,10 +79,10 @@ def _guess_log_level_from_message(message: str) -> int:
7979
"""Guess the log level from the message."""
8080
# Using only levels explicitly mentioned in the logging module
8181
known_levels = ('CRITICAL', 'FATAL', 'ERROR', 'WARN', 'WARNING', 'INFO', 'DEBUG', 'NOTSET')
82+
level_names_to_levels = logging.getLevelNamesMapping()
8283
for level in known_levels:
8384
if level in message:
84-
# `getLevelName` returns an `int` when string is passed as input.
85-
return cast('int', logging.getLevelName(level))
85+
return level_names_to_levels[level]
8686
# Unknown log level. Fall back to the default.
8787
return logging.INFO
8888

0 commit comments

Comments
 (0)