package main

import (
	"fmt"
	"os"
	"time"
)

func main() {
	logFile, err := os.OpenFile("execution_log.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
	if err != nil {
		fmt.Println("Error opening log file:", err)
		return
	}
	defer logFile.Close()

	logFile.WriteString(fmt.Sprintf("Execution started at: %s\n", time.Now().Format(time.RFC3339)))
	logFile.WriteString("Logging execution progress...\n")

	// Simulate some work
	for i := 0; i < 5; i++ {
		logFile.WriteString(fmt.Sprintf("Step %d completed\n", i+1))
		time.Sleep(1 * time.Second)
	}

	logFile.WriteString("Execution completed successfully.\n")
}
