fix .log ending for empty parameter in linux systems

This commit is contained in:
Adrian Zürcher
2026-01-18 21:42:36 +01:00
parent 62238574cb
commit 40099fffc6

View File

@@ -35,7 +35,11 @@ func NewLogger(file string, cfg *Config) (*Logger, error) {
if file == "" { if file == "" {
file = os.Args[0] file = os.Args[0]
file = strings.Replace(filepath.Base(file), filepath.Ext(file), ".log", 1) if filepath.Ext(file) != "" {
file = strings.Replace(filepath.Base(file), filepath.Ext(file), ".log", 1)
} else {
file = filepath.Base(file) + ".log"
}
} }
encoderConfig := zap.NewProductionEncoderConfig() encoderConfig := zap.NewProductionEncoderConfig()