change API
This commit is contained in:
parent
0fae26a780
commit
4d263dad2b
|
@ -12,14 +12,15 @@ import (
|
|||
var once sync.Once
|
||||
var instance *logrus.Logger
|
||||
|
||||
func Get() logrus.Logger {
|
||||
func Get(logfile string) logrus.Logger {
|
||||
// once.Do(func() {
|
||||
// instance = initializeLogger()
|
||||
// })
|
||||
initLogger(logfile)
|
||||
return *instance
|
||||
}
|
||||
|
||||
func Init(logFile string) {
|
||||
func initLogger(logFile string) {
|
||||
log := logrus.New()
|
||||
path := build.Default.GOPATH + "/log/"
|
||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||
|
@ -40,5 +41,3 @@ func Init(logFile string) {
|
|||
instance = log
|
||||
//return *log
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user