Skip to content

Commit b5561a9

Browse files
♻️ Move global logging behind a CLI option.
1 parent df5390e commit b5561a9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/lapidary/render/cli.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
import logging
21
import sys
32
from pathlib import Path
43

54
import anyio
65
import asyncclick as click
76

8-
logger = logging.getLogger(__name__)
9-
logging.getLogger().setLevel(logging.DEBUG)
10-
117

128
@click.group()
139
@click.version_option(package_name='lapidary.render', prog_name='lapidary')
14-
def app() -> None:
15-
pass
10+
@click.option('--verbose', is_flag=True, help='Enable debug logs.', default=False)
11+
def app(verbose: bool) -> None:
12+
if verbose:
13+
import logging
14+
15+
logging.basicConfig()
16+
logging.getLogger('lapidary').setLevel(logging.DEBUG)
1617

1718

1819
@app.command()

0 commit comments

Comments
 (0)