func DefaultWithURL(sess *mongodb.MongoDB, opts ...Option) *Hook {
	var options []Option
	options = append(options, opts...)
	options = append(options, SetExec(NewExecWithURL(sess)))
	return New(options...)
}
DefaultWithURL create a default mongo hook
package hook
import (
	"fmt"
	"io"
	"os"
	"github.com/abulo/ratel/v2/queue"
	"github.com/abulo/ratel/v2/store/mongodb"
	"github.com/sirupsen/logrus"
)
var defaultOptions = options{
	maxQueues:  512,
	maxWorkers: 2,
	levels: []logrus.Level{
		logrus.FatalLevel,
		logrus.ErrorLevel,
		logrus.WarnLevel,
		logrus.InfoLevel,
		logrus.DebugLevel,
	},
	out: os.Stderr,
}
type FilterHandle func(*logrus.Entry) *logrus.Entry
type options struct {
	maxQueues  int
	maxWorkers int
	extra      map[string]interface{}
	exec       ExecCloser
	filter     FilterHandle
	levels     []logrus.Level
	out        io.Writer
}
func SetMaxQueues(maxQueues int) Option {
	return func(o *options) {
		o.maxQueues = maxQueues
	}
}
func SetMaxWorkers(maxWorkers int) Option {
	return func(o *options) {
		o.maxWorkers = maxWorkers
	}
}
func SetExtra(extra map[string]interface{}) Option {
	return func(o *options) {
		o.extra = extra
	}
}
func SetExec(exec ExecCloser) Option {
	return func(o *options) {
		o.exec = exec
	}
}
func SetFilter(filter FilterHandle) Option {
	return func(o *options) {
		o.filter = filter
	}
}
func SetLevels(levels ...logrus.Level) Option {
	return func(o *options) {
		if len(levels) == 0 {
			return
		}
		o.levels = levels
	}
}
func SetOut(out io.Writer) Option {
	return func(o *options) {
		o.out = out
	}
}
type Option func(*options)
func Default(sess *mongodb.MongoDB, opts ...Option) *Hook {
	var options []Option
	options = append(options, opts...)
	options = append(options, SetExec(NewExec(sess)))
	return New(options...)
}