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