import time
import datetime

# This file should exist and be writable in the same directory you run nohup from
log_file_path = "simple_test_output.log" 

with open(log_file_path, "a") as f:
    f.write(f"[{datetime.datetime.now()}] Test log started.\n")

# Loop for a bit to make sure it keeps logging
for i in range(5):
    with open(log_file_path, "a") as f:
        f.write(f"[{datetime.datetime.now()}] Still alive: {i}\n")
    time.sleep(5) # Write every 5 seconds

with open(log_file_path, "a") as f:
    f.write(f"[{datetime.datetime.now()}] Test log finished.\n")