forked from mirror/gorm
Fix change log level
This commit is contained in:
parent
49310d0974
commit
ae9e4f1dd8
|
@ -100,8 +100,9 @@ type logger struct {
|
|||
|
||||
// LogMode log mode
|
||||
func (l *logger) LogMode(level LogLevel) Interface {
|
||||
l.LogLevel = level
|
||||
return l
|
||||
newlogger := *l
|
||||
newlogger.LogLevel = level
|
||||
return &newlogger
|
||||
}
|
||||
|
||||
// Info print info
|
||||
|
|
|
@ -20,7 +20,7 @@ func TestNamedPolymorphic(t *testing.T) {
|
|||
DB.Save(&hamster)
|
||||
|
||||
hamster2 := Hamster{}
|
||||
DB.Debug().Preload("PreferredToy").Preload("OtherToy").Find(&hamster2, hamster.Id)
|
||||
DB.Preload("PreferredToy").Preload("OtherToy").Find(&hamster2, hamster.Id)
|
||||
|
||||
if hamster2.PreferredToy.ID != hamster.PreferredToy.ID || hamster2.PreferredToy.Name != hamster.PreferredToy.Name {
|
||||
t.Errorf("Hamster's preferred toy failed to preload")
|
||||
|
|
Loading…
Reference in New Issue