Skip to content

Commit

Permalink
Fix: Log level could not be configured from settings
Browse files Browse the repository at this point in the history
Solution: Add a `LOG_LEVEL` setting defaulting to "WARNING".
  • Loading branch information
hoh authored and olethanh committed Sep 2, 2024
1 parent b74d05f commit 0d2a1ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/aleph/vm/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class Settings(BaseSettings):
# System logs make boot ~2x slower
PRINT_SYSTEM_LOGS = False
IGNORE_TRACEBACK_FROM_DIAGNOSTICS = True
LOG_LEVEL = "WARNING"
DEBUG_ASYNCIO = False

# Networking does not work inside Docker/Podman
Expand Down
10 changes: 6 additions & 4 deletions src/aleph/vm/orchestrator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,6 @@ def main():
if args.profile
else "%(asctime)s | %(levelname)s | %(message)s"
)
logging.basicConfig(
level=args.loglevel,
format=log_format,
)

settings.update(
USE_JAILER=args.use_jailer,
Expand All @@ -307,6 +303,12 @@ def main():
FAKE_DATA_PROGRAM=args.fake_data_program,
DEBUG_ASYNCIO=args.debug_asyncio,
FAKE_INSTANCE_BASE=args.fake_instance_base,
LOG_LEVEL=logging.getLevelName(args.loglevel),
)

logging.basicConfig(
level=settings.loglevel,
format=log_format,
)

if args.run_fake_instance:
Expand Down

0 comments on commit 0d2a1ac

Please sign in to comment.