Skip to content

Commit

Permalink
fix: Removed log_level from env
Browse files Browse the repository at this point in the history
  • Loading branch information
asafgardin committed Dec 17, 2023
1 parent be46ab1 commit 8a2966e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
2 changes: 0 additions & 2 deletions ai21/ai21_env_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class _AI21EnvConfig:
timeout_sec: Optional[int] = None
num_retries: Optional[int] = None
aws_region: Optional[str] = None
log_level: str = "warning"

@classmethod
def from_env(cls) -> _AI21EnvConfig:
Expand All @@ -31,7 +30,6 @@ def from_env(cls) -> _AI21EnvConfig:
timeout_sec=os.getenv("AI21_TIMEOUT_SEC"),
num_retries=os.getenv("AI21_NUM_RETRIES"),
aws_region=os.getenv("AI21_AWS_REGION", "us-east-1"),
log_level=os.getenv("AI21_LOG_LEVEL", "warning"),
)


Expand Down
18 changes: 0 additions & 18 deletions ai21/utils.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
import logging

from ai21.ai21_env_config import AI21EnvConfig

logger = logging.getLogger("ai21")


def log_info(message):
if AI21EnvConfig.log_level == "debug":
print(message)
logger.debug(message)
elif AI21EnvConfig.log_level == "info":
logger.info(message)


def log_error(message):
logger.error(message)


def log_warning(message):
logger.warning(message)

0 comments on commit 8a2966e

Please sign in to comment.