Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b53f0a09b2 | |||
| 40099fffc6 |
@@ -1,4 +1,4 @@
|
|||||||
module gitea.tecamino.com/paadi/tecamino-logger
|
module gitea.tecamino.local/paadi/tecamino-logger
|
||||||
|
|
||||||
go 1.21.0
|
go 1.21.0
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"gitea.tecamino.com/paadi/tecamino-logger/logging"
|
"gitea.tecamino.local/paadi/tecamino-logger/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLogger(t *testing.T) {
|
func TestLogger(t *testing.T) {
|
||||||
|
|||||||
@@ -35,7 +35,11 @@ func NewLogger(file string, cfg *Config) (*Logger, error) {
|
|||||||
|
|
||||||
if file == "" {
|
if file == "" {
|
||||||
file = os.Args[0]
|
file = os.Args[0]
|
||||||
|
if filepath.Ext(file) != "" {
|
||||||
file = strings.Replace(filepath.Base(file), filepath.Ext(file), ".log", 1)
|
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