Skip to content

Commit

Permalink
fix log bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoxiang committed Oct 27, 2024
1 parent 1b9abc1 commit 1371d49
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ func (f *customFormatter) Format(entry *logrus.Entry) ([]byte, error) {

func init() {
userConfigDir, _ := os.UserConfigDir()
logFilePath := filepath.Join(userConfigDir, GeektimeLogFolder, GeektimeLogFolder+".log")
logDir := filepath.Join(userConfigDir, GeektimeLogFolder)
logFilePath := filepath.Join(logDir, GeektimeLogFolder+".log")

if err := os.MkdirAll(logDir, 0755); err != nil {
logger.Fatalf("Failed to create log directory: %v", err)
}

logger.SetReportCaller(true)
logger.SetLevel(logrus.InfoLevel)
Expand Down

0 comments on commit 1371d49

Please sign in to comment.