Skip to content

Commit

Permalink
change logging directory
Browse files Browse the repository at this point in the history
  • Loading branch information
a1eaiactaest committed May 23, 2024
1 parent ed2f8e1 commit 30a1934
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,10 @@ func main() {
}

func setupLogfile() (*os.File, error) {
if err := os.MkdirAll("logs", 0755); err != nil {
if err := os.MkdirAll("/var/log", 0755); err != nil {
return nil, fmt.Errorf("failed to make the log directory: %v", err)
}
logfile, err := os.OpenFile("logs/mactop.log", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0660)
logfile, err := os.OpenFile("/var/log/mactop.log", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0660)
if err != nil {
return nil, fmt.Errorf("failed to open log file: %v", err)
}
Expand Down

0 comments on commit 30a1934

Please sign in to comment.