Skip to content

Commit

Permalink
Enable Bolt logger configuration for ExecuteQuery
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Biville <florent.biville@neo4j.com>
  • Loading branch information
robsdedude authored and fbiville committed Mar 16, 2023
1 parent 94b10f6 commit deab2cd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions neo4j/driver_with_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,15 @@ func ExecuteQueryWithoutBookmarkManager() ExecuteQueryConfigurationOption {
}
}

// ExecuteQueryWithBoltLogger configures DriverWithContext.ExecuteQuery to log Bolt messages with the provided BoltLogger
//
// This API is currently experimental and may change or be removed at any time.
func ExecuteQueryWithBoltLogger(boltLogger log.BoltLogger) ExecuteQueryConfigurationOption {
return func(configuration *ExecuteQueryConfiguration) {
configuration.BoltLogger = boltLogger
}
}

// ExecuteQueryConfiguration holds all the possible configuration settings for DriverWithContext.ExecuteQuery
//
// This API is currently experimental and may change or be removed at any time.
Expand All @@ -616,6 +625,7 @@ type ExecuteQueryConfiguration struct {
ImpersonatedUser string
Database string
BookmarkManager BookmarkManager
BoltLogger log.BoltLogger
}

// RoutingControl specifies how the query executed by DriverWithContext.ExecuteQuery is to be routed
Expand All @@ -639,6 +649,7 @@ func (c *ExecuteQueryConfiguration) toSessionConfig() SessionConfig {
ImpersonatedUser: c.ImpersonatedUser,
DatabaseName: c.Database,
BookmarkManager: c.BookmarkManager,
BoltLogger: c.BoltLogger,
}
}

Expand Down

0 comments on commit deab2cd

Please sign in to comment.