func (p *Plugin) addCreated(scope *gorm.Scope) {
	if isLoggable(scope.Value) && isEnabled(scope.Value) {
		_ = addRecord(scope, actionCreate)
	}
}
Hook for after_create.
package loggable
import (
	"encoding/json"
	"reflect"
	"github.com/gofrs/uuid"
	"github.com/jinzhu/gorm"
)
var im = newIdentityManager()
const (
	actionCreate = "create"
	actionUpdate = "update"
	actionDelete = "delete"
)
type UpdateDiff map[string]interface{}
func (p *Plugin) trackEntity(scope *gorm.Scope) {
	if !isLoggable(scope.Value) || !isEnabled(scope.Value) {
		return
	}
	v := reflect.Indirect(reflect.ValueOf(scope.Value))
	pkName := scope.PrimaryField().Name
	if v.Kind() == reflect.Slice {
		for i := 0; i < v.Len(); i++ {
			sv := reflect.Indirect(v.Index(i))
			el := sv.Interface()
			if !isLoggable(el) {
				continue
			}
			im.save(el, sv.FieldByName(pkName))
		}
		return
	}
	m := v.Interface()
	if !isLoggable(m) {
		return
	}
	im.save(scope.Value, scope.PrimaryKeyValue())
}