feat : logger type error to fatal
This commit is contained in:
1 parent
e5d22c78c8
commit
93ac874312
1 file changed
+2
-2
@@ -20,13 +20,13 @@ func (e *Mysql) Setup() {
|
|||||||
global.Logger.Info(tools.Green(global.Source))
|
global.Logger.Info(tools.Green(global.Source))
|
||||||
global.Eloquent, err = db.Open(db.GetDriver(), db.GetConnect())
|
global.Eloquent, err = db.Open(db.GetDriver(), db.GetConnect())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
global.Logger.Error(tools.Red(db.GetDriver()+" connect error :"), err)
|
global.Logger.Fatal(tools.Red(db.GetDriver()+" connect error :"), err)
|
||||||
} else {
|
} else {
|
||||||
global.Logger.Info(tools.Green(db.GetDriver() + " connect success !"))
|
global.Logger.Info(tools.Green(db.GetDriver() + " connect success !"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if global.Eloquent.Error != nil {
|
if global.Eloquent.Error != nil {
|
||||||
global.Logger.Error(tools.Red(" database error :"), global.Eloquent.Error)
|
global.Logger.Fatal(tools.Red(" database error :"), global.Eloquent.Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
global.Eloquent.LogMode(config.LoggerConfig.EnabledDB)
|
global.Eloquent.LogMode(config.LoggerConfig.EnabledDB)
|
||||||
|
|||||||
Reference in new issue
Block a user