Skip to content

Commit

Permalink
Add missing annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
leorudczenko committed May 17, 2024
1 parent 4776696 commit 3268a67
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions etlhelper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
PackageNotFoundError,
version,
)
from typing import TextIO

# Import helper functions here for more convenient access
from etlhelper.abort import abort_etlhelper_threads
Expand Down Expand Up @@ -46,7 +47,10 @@
logging.getLogger("etlhelper").handlers.clear()


def log_to_console(level=logging.INFO, output=sys.stderr) -> None:
def log_to_console(
level: int = logging.INFO,
output: TextIO = sys.stderr,
) -> None:
"""
Log ETL Helper messages to the given output.
Expand All @@ -63,7 +67,7 @@ class CleanDebugMessageFormatter(logging.Formatter):
default_fmt = logging.Formatter('%(asctime)s %(funcName)s: %(message)s')
debug_fmt = logging.Formatter('%(message)s')

def format(self, record):
def format(self, record: logging.LogRecord) -> str:
if record.levelno < logging.INFO:
return self.debug_fmt.format(record)
else:
Expand Down

0 comments on commit 3268a67

Please sign in to comment.