mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: change verbose option to debug
Summary: Change the Verbose option to Debug Reviewed By: alexsn Differential Revision: D17091911 fbshipit-source-id: c5cf3e1c7f33f607076fe5c7da94e04b9f236218
This commit is contained in:
committed by
Facebook Github Bot
parent
a964901521
commit
e7fec6f8f9
@@ -47,7 +47,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ent: starting a transaction: %v", err)
|
||||
}
|
||||
cfg := config{driver: tx, log: c.log, verbose: c.verbose}
|
||||
cfg := config{driver: tx, log: c.log, debug: c.debug}
|
||||
return &Tx{
|
||||
config: cfg,
|
||||
City: NewCityClient(cfg),
|
||||
|
||||
@@ -11,11 +11,11 @@ type Option func(*config)
|
||||
|
||||
// Config is the configuration for the client and its builder.
|
||||
type config struct {
|
||||
// driver is the driver used for execute database requests.
|
||||
// driver used for executing database requests.
|
||||
driver dialect.Driver
|
||||
// verbose enable a verbosity logging.
|
||||
verbose bool
|
||||
// log used for logging on verbose mode.
|
||||
// debug enable a debug logging.
|
||||
debug bool
|
||||
// log used for logging on debug mode.
|
||||
log func(...interface{})
|
||||
}
|
||||
|
||||
@@ -24,19 +24,19 @@ func (c *config) options(opts ...Option) {
|
||||
for _, opt := range opts {
|
||||
opt(c)
|
||||
}
|
||||
if c.verbose {
|
||||
if c.debug {
|
||||
c.driver = dialect.Debug(c.driver, c.log)
|
||||
}
|
||||
}
|
||||
|
||||
// Verbose sets the client logging to verbose.
|
||||
func Verbose() Option {
|
||||
// Debug enables debug logging on the ent.Driver.
|
||||
func Debug() Option {
|
||||
return func(c *config) {
|
||||
c.verbose = true
|
||||
c.debug = true
|
||||
}
|
||||
}
|
||||
|
||||
// Log sets the client logging to verbose.
|
||||
// Log sets the logging function for debug mode.
|
||||
func Log(fn func(...interface{})) Option {
|
||||
return func(c *config) {
|
||||
c.log = fn
|
||||
|
||||
@@ -47,7 +47,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ent: starting a transaction: %v", err)
|
||||
}
|
||||
cfg := config{driver: tx, log: c.log, verbose: c.verbose}
|
||||
cfg := config{driver: tx, log: c.log, debug: c.debug}
|
||||
return &Tx{
|
||||
config: cfg,
|
||||
Group: NewGroupClient(cfg),
|
||||
|
||||
@@ -11,11 +11,11 @@ type Option func(*config)
|
||||
|
||||
// Config is the configuration for the client and its builder.
|
||||
type config struct {
|
||||
// driver is the driver used for execute database requests.
|
||||
// driver used for executing database requests.
|
||||
driver dialect.Driver
|
||||
// verbose enable a verbosity logging.
|
||||
verbose bool
|
||||
// log used for logging on verbose mode.
|
||||
// debug enable a debug logging.
|
||||
debug bool
|
||||
// log used for logging on debug mode.
|
||||
log func(...interface{})
|
||||
}
|
||||
|
||||
@@ -24,19 +24,19 @@ func (c *config) options(opts ...Option) {
|
||||
for _, opt := range opts {
|
||||
opt(c)
|
||||
}
|
||||
if c.verbose {
|
||||
if c.debug {
|
||||
c.driver = dialect.Debug(c.driver, c.log)
|
||||
}
|
||||
}
|
||||
|
||||
// Verbose sets the client logging to verbose.
|
||||
func Verbose() Option {
|
||||
// Debug enables debug logging on the ent.Driver.
|
||||
func Debug() Option {
|
||||
return func(c *config) {
|
||||
c.verbose = true
|
||||
c.debug = true
|
||||
}
|
||||
}
|
||||
|
||||
// Log sets the client logging to verbose.
|
||||
// Log sets the logging function for debug mode.
|
||||
func Log(fn func(...interface{})) Option {
|
||||
return func(c *config) {
|
||||
c.log = fn
|
||||
|
||||
@@ -43,7 +43,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ent: starting a transaction: %v", err)
|
||||
}
|
||||
cfg := config{driver: tx, log: c.log, verbose: c.verbose}
|
||||
cfg := config{driver: tx, log: c.log, debug: c.debug}
|
||||
return &Tx{
|
||||
config: cfg,
|
||||
User: NewUserClient(cfg),
|
||||
|
||||
@@ -11,11 +11,11 @@ type Option func(*config)
|
||||
|
||||
// Config is the configuration for the client and its builder.
|
||||
type config struct {
|
||||
// driver is the driver used for execute database requests.
|
||||
// driver used for executing database requests.
|
||||
driver dialect.Driver
|
||||
// verbose enable a verbosity logging.
|
||||
verbose bool
|
||||
// log used for logging on verbose mode.
|
||||
// debug enable a debug logging.
|
||||
debug bool
|
||||
// log used for logging on debug mode.
|
||||
log func(...interface{})
|
||||
}
|
||||
|
||||
@@ -24,19 +24,19 @@ func (c *config) options(opts ...Option) {
|
||||
for _, opt := range opts {
|
||||
opt(c)
|
||||
}
|
||||
if c.verbose {
|
||||
if c.debug {
|
||||
c.driver = dialect.Debug(c.driver, c.log)
|
||||
}
|
||||
}
|
||||
|
||||
// Verbose sets the client logging to verbose.
|
||||
func Verbose() Option {
|
||||
// Debug enables debug logging on the ent.Driver.
|
||||
func Debug() Option {
|
||||
return func(c *config) {
|
||||
c.verbose = true
|
||||
c.debug = true
|
||||
}
|
||||
}
|
||||
|
||||
// Log sets the client logging to verbose.
|
||||
// Log sets the logging function for debug mode.
|
||||
func Log(fn func(...interface{})) Option {
|
||||
return func(c *config) {
|
||||
c.log = fn
|
||||
|
||||
@@ -43,7 +43,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ent: starting a transaction: %v", err)
|
||||
}
|
||||
cfg := config{driver: tx, log: c.log, verbose: c.verbose}
|
||||
cfg := config{driver: tx, log: c.log, debug: c.debug}
|
||||
return &Tx{
|
||||
config: cfg,
|
||||
User: NewUserClient(cfg),
|
||||
|
||||
@@ -11,11 +11,11 @@ type Option func(*config)
|
||||
|
||||
// Config is the configuration for the client and its builder.
|
||||
type config struct {
|
||||
// driver is the driver used for execute database requests.
|
||||
// driver used for executing database requests.
|
||||
driver dialect.Driver
|
||||
// verbose enable a verbosity logging.
|
||||
verbose bool
|
||||
// log used for logging on verbose mode.
|
||||
// debug enable a debug logging.
|
||||
debug bool
|
||||
// log used for logging on debug mode.
|
||||
log func(...interface{})
|
||||
}
|
||||
|
||||
@@ -24,19 +24,19 @@ func (c *config) options(opts ...Option) {
|
||||
for _, opt := range opts {
|
||||
opt(c)
|
||||
}
|
||||
if c.verbose {
|
||||
if c.debug {
|
||||
c.driver = dialect.Debug(c.driver, c.log)
|
||||
}
|
||||
}
|
||||
|
||||
// Verbose sets the client logging to verbose.
|
||||
func Verbose() Option {
|
||||
// Debug enables debug logging on the ent.Driver.
|
||||
func Debug() Option {
|
||||
return func(c *config) {
|
||||
c.verbose = true
|
||||
c.debug = true
|
||||
}
|
||||
}
|
||||
|
||||
// Log sets the client logging to verbose.
|
||||
// Log sets the logging function for debug mode.
|
||||
func Log(fn func(...interface{})) Option {
|
||||
return func(c *config) {
|
||||
c.log = fn
|
||||
|
||||
@@ -47,7 +47,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ent: starting a transaction: %v", err)
|
||||
}
|
||||
cfg := config{driver: tx, log: c.log, verbose: c.verbose}
|
||||
cfg := config{driver: tx, log: c.log, debug: c.debug}
|
||||
return &Tx{
|
||||
config: cfg,
|
||||
Pet: NewPetClient(cfg),
|
||||
|
||||
@@ -11,11 +11,11 @@ type Option func(*config)
|
||||
|
||||
// Config is the configuration for the client and its builder.
|
||||
type config struct {
|
||||
// driver is the driver used for execute database requests.
|
||||
// driver used for executing database requests.
|
||||
driver dialect.Driver
|
||||
// verbose enable a verbosity logging.
|
||||
verbose bool
|
||||
// log used for logging on verbose mode.
|
||||
// debug enable a debug logging.
|
||||
debug bool
|
||||
// log used for logging on debug mode.
|
||||
log func(...interface{})
|
||||
}
|
||||
|
||||
@@ -24,19 +24,19 @@ func (c *config) options(opts ...Option) {
|
||||
for _, opt := range opts {
|
||||
opt(c)
|
||||
}
|
||||
if c.verbose {
|
||||
if c.debug {
|
||||
c.driver = dialect.Debug(c.driver, c.log)
|
||||
}
|
||||
}
|
||||
|
||||
// Verbose sets the client logging to verbose.
|
||||
func Verbose() Option {
|
||||
// Debug enables debug logging on the ent.Driver.
|
||||
func Debug() Option {
|
||||
return func(c *config) {
|
||||
c.verbose = true
|
||||
c.debug = true
|
||||
}
|
||||
}
|
||||
|
||||
// Log sets the client logging to verbose.
|
||||
// Log sets the logging function for debug mode.
|
||||
func Log(fn func(...interface{})) Option {
|
||||
return func(c *config) {
|
||||
c.log = fn
|
||||
|
||||
@@ -43,7 +43,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ent: starting a transaction: %v", err)
|
||||
}
|
||||
cfg := config{driver: tx, log: c.log, verbose: c.verbose}
|
||||
cfg := config{driver: tx, log: c.log, debug: c.debug}
|
||||
return &Tx{
|
||||
config: cfg,
|
||||
Node: NewNodeClient(cfg),
|
||||
|
||||
@@ -11,11 +11,11 @@ type Option func(*config)
|
||||
|
||||
// Config is the configuration for the client and its builder.
|
||||
type config struct {
|
||||
// driver is the driver used for execute database requests.
|
||||
// driver used for executing database requests.
|
||||
driver dialect.Driver
|
||||
// verbose enable a verbosity logging.
|
||||
verbose bool
|
||||
// log used for logging on verbose mode.
|
||||
// debug enable a debug logging.
|
||||
debug bool
|
||||
// log used for logging on debug mode.
|
||||
log func(...interface{})
|
||||
}
|
||||
|
||||
@@ -24,19 +24,19 @@ func (c *config) options(opts ...Option) {
|
||||
for _, opt := range opts {
|
||||
opt(c)
|
||||
}
|
||||
if c.verbose {
|
||||
if c.debug {
|
||||
c.driver = dialect.Debug(c.driver, c.log)
|
||||
}
|
||||
}
|
||||
|
||||
// Verbose sets the client logging to verbose.
|
||||
func Verbose() Option {
|
||||
// Debug enables debug logging on the ent.Driver.
|
||||
func Debug() Option {
|
||||
return func(c *config) {
|
||||
c.verbose = true
|
||||
c.debug = true
|
||||
}
|
||||
}
|
||||
|
||||
// Log sets the client logging to verbose.
|
||||
// Log sets the logging function for debug mode.
|
||||
func Log(fn func(...interface{})) Option {
|
||||
return func(c *config) {
|
||||
c.log = fn
|
||||
|
||||
@@ -47,7 +47,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ent: starting a transaction: %v", err)
|
||||
}
|
||||
cfg := config{driver: tx, log: c.log, verbose: c.verbose}
|
||||
cfg := config{driver: tx, log: c.log, debug: c.debug}
|
||||
return &Tx{
|
||||
config: cfg,
|
||||
Card: NewCardClient(cfg),
|
||||
|
||||
@@ -11,11 +11,11 @@ type Option func(*config)
|
||||
|
||||
// Config is the configuration for the client and its builder.
|
||||
type config struct {
|
||||
// driver is the driver used for execute database requests.
|
||||
// driver used for executing database requests.
|
||||
driver dialect.Driver
|
||||
// verbose enable a verbosity logging.
|
||||
verbose bool
|
||||
// log used for logging on verbose mode.
|
||||
// debug enable a debug logging.
|
||||
debug bool
|
||||
// log used for logging on debug mode.
|
||||
log func(...interface{})
|
||||
}
|
||||
|
||||
@@ -24,19 +24,19 @@ func (c *config) options(opts ...Option) {
|
||||
for _, opt := range opts {
|
||||
opt(c)
|
||||
}
|
||||
if c.verbose {
|
||||
if c.debug {
|
||||
c.driver = dialect.Debug(c.driver, c.log)
|
||||
}
|
||||
}
|
||||
|
||||
// Verbose sets the client logging to verbose.
|
||||
func Verbose() Option {
|
||||
// Debug enables debug logging on the ent.Driver.
|
||||
func Debug() Option {
|
||||
return func(c *config) {
|
||||
c.verbose = true
|
||||
c.debug = true
|
||||
}
|
||||
}
|
||||
|
||||
// Log sets the client logging to verbose.
|
||||
// Log sets the logging function for debug mode.
|
||||
func Log(fn func(...interface{})) Option {
|
||||
return func(c *config) {
|
||||
c.log = fn
|
||||
|
||||
@@ -43,7 +43,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ent: starting a transaction: %v", err)
|
||||
}
|
||||
cfg := config{driver: tx, log: c.log, verbose: c.verbose}
|
||||
cfg := config{driver: tx, log: c.log, debug: c.debug}
|
||||
return &Tx{
|
||||
config: cfg,
|
||||
User: NewUserClient(cfg),
|
||||
|
||||
@@ -11,11 +11,11 @@ type Option func(*config)
|
||||
|
||||
// Config is the configuration for the client and its builder.
|
||||
type config struct {
|
||||
// driver is the driver used for execute database requests.
|
||||
// driver used for executing database requests.
|
||||
driver dialect.Driver
|
||||
// verbose enable a verbosity logging.
|
||||
verbose bool
|
||||
// log used for logging on verbose mode.
|
||||
// debug enable a debug logging.
|
||||
debug bool
|
||||
// log used for logging on debug mode.
|
||||
log func(...interface{})
|
||||
}
|
||||
|
||||
@@ -24,19 +24,19 @@ func (c *config) options(opts ...Option) {
|
||||
for _, opt := range opts {
|
||||
opt(c)
|
||||
}
|
||||
if c.verbose {
|
||||
if c.debug {
|
||||
c.driver = dialect.Debug(c.driver, c.log)
|
||||
}
|
||||
}
|
||||
|
||||
// Verbose sets the client logging to verbose.
|
||||
func Verbose() Option {
|
||||
// Debug enables debug logging on the ent.Driver.
|
||||
func Debug() Option {
|
||||
return func(c *config) {
|
||||
c.verbose = true
|
||||
c.debug = true
|
||||
}
|
||||
}
|
||||
|
||||
// Log sets the client logging to verbose.
|
||||
// Log sets the logging function for debug mode.
|
||||
func Log(fn func(...interface{})) Option {
|
||||
return func(c *config) {
|
||||
c.log = fn
|
||||
|
||||
@@ -43,7 +43,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ent: starting a transaction: %v", err)
|
||||
}
|
||||
cfg := config{driver: tx, log: c.log, verbose: c.verbose}
|
||||
cfg := config{driver: tx, log: c.log, debug: c.debug}
|
||||
return &Tx{
|
||||
config: cfg,
|
||||
Node: NewNodeClient(cfg),
|
||||
|
||||
@@ -11,11 +11,11 @@ type Option func(*config)
|
||||
|
||||
// Config is the configuration for the client and its builder.
|
||||
type config struct {
|
||||
// driver is the driver used for execute database requests.
|
||||
// driver used for executing database requests.
|
||||
driver dialect.Driver
|
||||
// verbose enable a verbosity logging.
|
||||
verbose bool
|
||||
// log used for logging on verbose mode.
|
||||
// debug enable a debug logging.
|
||||
debug bool
|
||||
// log used for logging on debug mode.
|
||||
log func(...interface{})
|
||||
}
|
||||
|
||||
@@ -24,19 +24,19 @@ func (c *config) options(opts ...Option) {
|
||||
for _, opt := range opts {
|
||||
opt(c)
|
||||
}
|
||||
if c.verbose {
|
||||
if c.debug {
|
||||
c.driver = dialect.Debug(c.driver, c.log)
|
||||
}
|
||||
}
|
||||
|
||||
// Verbose sets the client logging to verbose.
|
||||
func Verbose() Option {
|
||||
// Debug enables debug logging on the ent.Driver.
|
||||
func Debug() Option {
|
||||
return func(c *config) {
|
||||
c.verbose = true
|
||||
c.debug = true
|
||||
}
|
||||
}
|
||||
|
||||
// Log sets the client logging to verbose.
|
||||
// Log sets the logging function for debug mode.
|
||||
func Log(fn func(...interface{})) Option {
|
||||
return func(c *config) {
|
||||
c.log = fn
|
||||
|
||||
Reference in New Issue
Block a user