Remove specific log functions and unnecessary comments

This commit is contained in:
Dmitrii Andreev
2024-01-07 16:51:32 +03:00
parent 777652c24e
commit fa18939c3e
2 changed files with 1 additions and 28 deletions

View File

@@ -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" ]

View File

@@ -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)