Skip to content

Commit

Permalink
Merge pull request #194 from BritishGeologicalSurvey/adjust-annotations
Browse files Browse the repository at this point in the history
Adjust annotations
  • Loading branch information
volcan01010 authored May 17, 2024
2 parents b0441bf + 3268a67 commit 93a5aa7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ per-file-ignores =
row_factories.py: A
utils.py: A,
etlhelper/db_helpers/*: A,
test/**: A
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 93a5aa7

Please sign in to comment.