mirror of
https://github.com/kemko/icecast-ripper.git
synced 2026-01-01 15:55:42 +03:00
Remove specific log functions and unnecessary comments
This commit is contained in:
@@ -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" ]
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user