direct to main for docker and logging fix
This commit is contained in:
12
app/main.py
12
app/main.py
@@ -58,8 +58,12 @@ import pytz
|
||||
from datetime import datetime
|
||||
|
||||
def log(str):
|
||||
with open("logs/log.md", "at") as file:
|
||||
file.write(str)
|
||||
try:
|
||||
with open("logs/log.md", "a") as file:
|
||||
file.write(str)
|
||||
except FileNotFoundError:
|
||||
os.system("touch logs/log.md")
|
||||
log("#### log.md was not found, so it was just touched.")
|
||||
|
||||
### OpenAI Config
|
||||
|
||||
@@ -125,4 +129,6 @@ def get_auto_transcript(video_id):
|
||||
txt_transcript = formatter.format_transcript(transcript)
|
||||
return txt_transcript
|
||||
|
||||
output_stream = StreamOutput()
|
||||
output_stream = StreamOutput()
|
||||
|
||||
log(f"# Main initilized at {datetime.now(pytz.timezone('America/New_York')).strftime('%Y-%m-%d %H:%M:%S')}. Presumeably application starting.")
|
||||
Reference in New Issue
Block a user