Skip to content

Commit

Permalink
update loglevel
Browse files Browse the repository at this point in the history
  • Loading branch information
jackaraz committed Oct 4, 2024
1 parent 47d336f commit eb9826a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/spey/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ def set_log_level(level: Literal[0, 1, 2, 3]) -> None:
"""
Set log level for spey
Log level can also be set through terminal by the following command
.. code::
export SPEY_LOGLEVEL=3
value corresponds to the levels shown below.
Args:
level (``int``): log level
Expand Down Expand Up @@ -332,5 +340,8 @@ def cite() -> List[Text]:
return ""


if int(os.environ.get("SPEY_LOGLEVEL", -1)) >= 0:
set_log_level(int(os.environ.get("SPEY_LOGLEVEL")))

if os.environ.get("SPEY_CHECKUPDATE", "ON").upper() != "OFF":
check_updates()

0 comments on commit eb9826a

Please sign in to comment.