Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
FleMo93 committed Apr 18, 2021
1 parent 0c782ac commit c5bc2dd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ type WeatherSettings struct {
}

func main() {
logFile := filepath.Base(os.Args[0]) + ".log"
file, err := os.OpenFile(logFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)
if err != nil {
log.Fatal(err)
}
log.SetOutput(file)

arg := os.Args
var missionFile = ""
for _, ele := range arg {
Expand Down

0 comments on commit c5bc2dd

Please sign in to comment.