Skip to content

Commit

Permalink
Fixed the implementation with intended logic
Browse files Browse the repository at this point in the history
  • Loading branch information
DhruvSondhi committed Aug 9, 2021
1 parent 2e60ac1 commit 79291e7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions tardis/io/logger/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,28 @@ def logging_state(log_level, tardis_config, specific_log_level):
print(
"log_level is defined both in Functional Argument & YAML Configuration {debug section}"
)
print(
f"log_level = {log_level.upper()} will be used for Log Level Determination\n"

logging_level = (
log_level if log_level else tardis_config["debug"]["log_level"]
)

# Displays a message when both log_level & tardis["debug"]["log_level"] are specified
if log_level and tardis_config["debug"]["log_level"]:
print(
"log_level is defined both in Functional Argument & YAML Configuration {debug section}"
)
print(
f"log_level = {log_level.upper()} will be used for Log Level Determination\n"
)

else:
# Adds empty `debug` section for the YAML
tardis_config["debug"] = {}

if log_level:
logging_level = log_level
else:
tardis_config["debug"] = {"log_level": DEFAULT_LOG_LEVEL}
tardis_config["debug"]["log_level"] = DEFAULT_LOG_LEVEL
logging_level = tardis_config["debug"]["log_level"]

if specific_log_level:
Expand Down

0 comments on commit 79291e7

Please sign in to comment.