Skip to content

Commit

Permalink
fix path for logs not cleaned
Browse files Browse the repository at this point in the history
  • Loading branch information
cottand committed Sep 30, 2024
1 parent cc8a440 commit 2fd2c3d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
Expand Down Expand Up @@ -95,6 +96,7 @@ func parseLogConfig(logConfigString string) (*logConfig, error) {
}

func createLogFile(fileName string) (*os.File, error) {
fileName = filepath.Clean(fileName)
if _, err := os.Stat(fileName); os.IsNotExist(err) {
if _, err := os.Create(fileName); err != nil {
return nil, fmt.Errorf("error creating log file '%s': %s", fileName, err)
Expand Down

0 comments on commit 2fd2c3d

Please sign in to comment.