From fa18939c3ecde78adeee98bb04e58bd48ff7c6c9 Mon Sep 17 00:00:00 2001 From: Dmitrii Andreev Date: Sun, 7 Jan 2024 16:51:32 +0300 Subject: [PATCH] Remove specific log functions and unnecessary comments --- Dockerfile | 6 ------ src/logger.py | 23 +---------------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1ff28d3..6bc5fc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,11 @@ -# Use an official Python runtime as the parent image FROM python:3.11-slim -# Set the working directory in the container WORKDIR /app -# Copy the current directory contents into the container at the working directory COPY . . -# Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt -# Make port 8080 available to the world outside this container EXPOSE 8080 -# Run main.py when the container launches CMD [ "python", "./src/main.py" ] diff --git a/src/logger.py b/src/logger.py index fffd3fd..c80211c 100644 --- a/src/logger.py +++ b/src/logger.py @@ -19,26 +19,5 @@ def log_event(event, details, level=INFO): "details": details } json_log_entry = json.dumps(log_entry) - print(json_log_entry, file=sys.stdout) # Write to stdout + print(json_log_entry, file=sys.stdout) sys.stdout.flush() # Immediately flush the log entry - -# Specific log functions per level for convenience -def log_debug(event, details): - """Log a debug event""" - log_event(event, details, level=DEBUG) - -def log_info(event, details): - """Log an info event""" - log_event(event, details, level=INFO) - -def log_warning(event, details): - """Log a warning event""" - log_event(event, details, level=WARNING) - -def log_error(event, details): - """Log an error event""" - log_event(event, details, level=ERROR) - -def log_fatal(event, details): - """Log a fatal event""" - log_event(event, details, level=FATAL)