Skip to content

Commit 61ad8a2

Browse files
committed
chg: pass logger down
1 parent 991d94f commit 61ad8a2

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/gps_logger_parser/cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import logging
2+
13
import typer
24
from upath import UPath
35

6+
from .logger import configure_logger
47
from .parser import detect_file
58

69
app = typer.Typer(
@@ -25,12 +28,15 @@ def parse(
2528
):
2629
params = {}
2730

31+
logging_level = logging.DEBUG if verbose else logging.INFO
32+
logger = configure_logger(logging_level=logging_level)
33+
2834
if file.startswith("s3://"):
2935
if s3_endpoint:
3036
params["endpoint_url"] = s3_endpoint
3137
params["anon"] = True
3238

33-
parser_instance = detect_file(UPath(file, **params))
39+
parser_instance = detect_file(UPath(file, **params), logger=logger)
3440
parser_instance.write_parquet(UPath(output))
3541

3642

src/gps_logger_parser/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
logger = logging.getLogger(__name__)
1717

1818

19-
def detect_file(path: UPath):
19+
def detect_file(path: UPath, *args, logger=logger, **kwargs):
2020
parsable = Parsable(file_path=path)
2121

2222
for parser in available_parsers:

0 commit comments

Comments
 (0)