Compare commits
1 Commits
62238574cb
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40099fffc6 |
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user