Skip to content

Commit

Permalink
Moved logging config out of swarm.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis-chambers committed May 30, 2024
1 parent ce55435 commit adb4b33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/iotdevicesimulator/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import asyncio
import config
from pathlib import Path
import logging


async def main(config_path: str):
Expand All @@ -14,6 +15,10 @@ async def main(config_path: str):
Args:
config_path: A path to the config file for credentials and connection points.
"""
log_config = Path(Path(__file__).parent, "__assets__", "loggers.ini")

logging.config.fileConfig(fname=log_config)

app_config = config.Config(config_path)

iot_config = app_config["iot_core"]
Expand Down
4 changes: 0 additions & 4 deletions src/iotdevicesimulator/swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
import uuid
import config

log_config = Path(Path(__file__).parent, "__assets__", "loggers.ini")

logging.config.fileConfig(fname=log_config)

logger = logging.getLogger(__name__)


Expand Down

0 comments on commit adb4b33

Please sign in to comment.