Skip to content

Commit

Permalink
refactor: Support different log levels for different environments (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
egekocabas authored Jan 10, 2024
1 parent 5a552d9 commit 55affb3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion parma_mining/github/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@
)
from parma_mining.github.normalization_map import GithubNormalizationMap

logging.basicConfig(level=logging.INFO)
env = os.getenv("env", "local")

if env == "prod":
logging.basicConfig(level=logging.INFO)
elif env in ["staging", "local"]:
logging.basicConfig(level=logging.DEBUG)
else:
logging.warning(f"Unknown environment '{env}'. Defaulting to INFO level.")
logging.basicConfig(level=logging.INFO)

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit 55affb3

Please sign in to comment.