Skip to content

Commit

Permalink
Use LoggerProto as type
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranvpl committed May 24, 2024
1 parent 009663a commit 93dacfb
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions faststream/confluent/client.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import asyncio
import logging
from ssl import SSLContext
from time import time
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Expand All @@ -17,10 +17,14 @@
from confluent_kafka import Consumer, KafkaError, KafkaException, Message, Producer
from confluent_kafka.admin import AdminClient, NewTopic
from pydantic import BaseModel
from typing_extensions import Annotated, Doc

from faststream.log import logger
from faststream.utils.functions import call_or_await

if TYPE_CHECKING:
from faststream.types import LoggerProto

_missing = object()


Expand Down Expand Up @@ -106,7 +110,10 @@ def __init__(
sasl_kerberos_service_name: str = "kafka",
sasl_kerberos_domain_name: Optional[str] = None,
sasl_oauth_token_provider: Optional[str] = None,
logger: Optional[logging.Logger] = logger,
logger: Annotated[
Union["LoggerProto", None, object],
Doc("User specified logger to pass into Context and log service messages."),
] = logger,
) -> None:
self.logger = logger
if isinstance(bootstrap_servers, Iterable) and not isinstance(
Expand Down Expand Up @@ -298,7 +305,10 @@ def __init__(
sasl_kerberos_service_name: str = "kafka",
sasl_kerberos_domain_name: Optional[str] = None,
sasl_oauth_token_provider: Optional[str] = None,
logger: Optional[logging.Logger] = logger,
logger: Annotated[
Union["LoggerProto", None, object],
Doc("User specified logger to pass into Context and log service messages."),
] = logger,
) -> None:
self.logger = logger
if group_id is None:
Expand Down

0 comments on commit 93dacfb

Please sign in to comment.