update logging to put all logs in one folder

This commit is contained in:
Daniel Prows 2023-08-09 20:33:24 -06:00
parent 259ef4a3d2
commit 45520c9513

View File

@ -20,8 +20,9 @@ func directory() string {
// Enable turns logging on for the StreamDeck API client as well as the global // Enable turns logging on for the StreamDeck API client as well as the global
// log object. It sends both to a temp file that contains <project_directory>.log. // log object. It sends both to a temp file that contains <project_directory>.log.
func Enable() { func Enable() {
os.Mkdir("./logs/", 0775)
d := directory() d := directory()
f, err := os.CreateTemp("./", fmt.Sprintf("%s.log", d)) f, err := os.CreateTemp("./logs/", fmt.Sprintf("%s.log", d))
if err != nil { if err != nil {
log.Fatalf("error creating temp file: %v", err) log.Fatalf("error creating temp file: %v", err)
} }