func newOrm(t testing.TB, url string, logging bool) *Orm { clearRegistry(nil) o, err := New(config.MustParseURL(url)) if err != nil { t.Fatal(err) } if logging { // Set logger o.SetLogger(log.Std) if testing.Verbose() && os.Getenv("ORM_TEST_DEBUG") != "" { log.SetLevel(log.LDebug) } } else { log.SetLevel(log.LInfo) } return o }
func newCache(url string) (*Cache, error) { return New(config.MustParseURL(url)) }