feat: add global & logger

This commit is contained in:
zhangwenjian committed 2020-06-19 22:09:49 +08:00
1 parent 7db16d04dd
commit b77f4b5a1b
43 files changed
+200 -181

No files matched your search

+1 -1
View File
@@ -2,9 +2,9 @@ package config
import (
"fmt"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"io/ioutil"
"log"
"os"
"strings"
)
+2
View File
@@ -4,11 +4,13 @@ import "github.com/spf13/viper"
type Log struct {
Dir string
Operdb bool
}
func InitLog(cfg *viper.Viper) *Log {
return &Log{
Dir: cfg.GetString("dir"),
Operdb: cfg.GetBool("operdb"),
}
}