diff --git a/.gitignore b/.gitignore index c6baa77..446b662 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,7 @@ tmp.go config.yaml +# Binary scc +# Log file +scc.log diff --git a/main.go b/main.go index 564f906..96f25a7 100644 --- a/main.go +++ b/main.go @@ -1,11 +1,21 @@ package main import ( + "log" + "os" "scc/api" "scc/screen" ) func main() { + // Logging + logFile, err := os.OpenFile("scc.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) + if err != nil { + log.Fatalf("Error: Failed to open log file: %s", err) + } + log.SetOutput(logFile) + log.SetFlags(log.LstdFlags | log.Lshortfile) + // Data holder for the screen screenApp := screen.NewScreenApp()