Skip to content

Commit

Permalink
fix no python logs in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Privatecoder committed Jun 10, 2024
1 parent cafb838 commit 6601cb3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ RUN pip install --no-cache-dir -r requirements.txt
# Copy the src directory contents into the container at /usr/src/app
COPY ./src .

# Define default environment variables
ENV PYTHONUNBUFFERED 1

# Make sure entrypoint is executable
RUN chmod +x /usr/src/app/entrypoint.sh

Expand Down
2 changes: 1 addition & 1 deletion src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fi
echo "Starting the script"

# Run the Python script in the background
python fetch_bms_data.py > /proc/1/fd/1 2> /proc/1/fd/2 &
python fetch_bms_data.py

# Wait for any process to exit
wait $!
2 changes: 1 addition & 1 deletion src/fetch_bms_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def get_config_value(var_name, return_type=str) -> int | float | bool | str | No

# Logging setup and config

logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', level=logging.INFO)
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s')
logger = logging.getLogger("SeplosBMS")

if get_config_value("LOGGING_LEVEL").upper() == "ERROR":
Expand Down

0 comments on commit 6601cb3

Please sign in to comment.