feat: add global & logger
This commit is contained in:
1 parent
7db16d04dd
commit
b77f4b5a1b
43 files changed
+200
-181
No files matched your search
@@ -2,9 +2,9 @@ package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/viper"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -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"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user