Skip to content

Commit 85fc6a7

Browse files
committed
thx drew
1 parent 4505f0c commit 85fc6a7

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

pyiceberg/cli/console.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# under the License.
1717
# pylint: disable=broad-except,redefined-builtin,redefined-outer-name
1818
import logging
19-
import os
2019
from collections.abc import Callable
2120
from functools import wraps
2221
from typing import (
@@ -35,8 +34,6 @@
3534
from pyiceberg.table.refs import SnapshotRef, SnapshotRefType
3635
from pyiceberg.utils.properties import property_as_int
3736

38-
DEFAULT_LOG_LEVEL = "WARNING"
39-
4037

4138
def catch_exception() -> Callable: # type: ignore
4239
def decorator(func: Callable) -> Callable: # type: ignore
@@ -62,7 +59,9 @@ def wrapper(*args: Any, **kwargs: Any): # type: ignore
6259
@click.option(
6360
"--log-level",
6461
type=click.Choice(["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], case_sensitive=False),
65-
help="Set the logging level (also configurable via PYICEBERG_LOG_LEVEL environment variable)",
62+
default="WARNING",
63+
envvar="PYICEBERG_LOG_LEVEL",
64+
help="Set the logging level",
6665
)
6766
@click.option("--ugi")
6867
@click.option("--uri")
@@ -73,15 +72,13 @@ def run(
7372
catalog: str | None,
7473
verbose: bool,
7574
output: str,
76-
log_level: str | None,
75+
log_level: str,
7776
ugi: str | None,
7877
uri: str | None,
7978
credential: str | None,
8079
) -> None:
81-
# Configure logging level from CLI option or environment variable
82-
level = log_level or os.getenv("PYICEBERG_LOG_LEVEL") or DEFAULT_LOG_LEVEL
8380
logging.basicConfig(
84-
level=getattr(logging, level.upper()),
81+
level=getattr(logging, log_level.upper()),
8582
format="%(levelname)s:%(name)s:%(message)s",
8683
)
8784

0 commit comments

Comments
 (0)