Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Change Batch API to be consistent with Query() (CASSGO-7)

- Remove deprecated global logger (CASSGO-24)

### Fixed

- Retry policy now takes into account query idempotency (CASSGO-27)
Expand Down
4 changes: 2 additions & 2 deletions cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ type ClusterConfig struct {
HostDialer HostDialer

// Logger for this ClusterConfig.
// If not specified, defaults to the global gocql.Logger.
// If not specified, defaults to the gocql.defaultLogger.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaultLogger is private so you'd have to look at the code to know what this does. Instead this should be:

// If not specified, defaults to using the log package.

Copy link
Contributor Author

@tengu-alt tengu-alt Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood, it makes sense. I will lay a hand on that on the next PRs.

Logger StdLogger

// internal config for testing
Expand Down Expand Up @@ -304,7 +304,7 @@ func NewCluster(hosts ...string) *ClusterConfig {

func (cfg *ClusterConfig) logger() StdLogger {
if cfg.Logger == nil {
return Logger
return &defaultLogger{}
}
return cfg.Logger
}
Expand Down
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ type ConnConfig struct {

func (c *ConnConfig) logger() StdLogger {
if c.Logger == nil {
return Logger
return &defaultLogger{}
}
return c.Logger
}
Expand Down
4 changes: 0 additions & 4 deletions logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,3 @@ type defaultLogger struct{}
func (l *defaultLogger) Print(v ...interface{}) { log.Print(v...) }
func (l *defaultLogger) Printf(format string, v ...interface{}) { log.Printf(format, v...) }
func (l *defaultLogger) Println(v ...interface{}) { log.Println(v...) }

// Logger for logging messages.
// Deprecated: Use ClusterConfig.Logger instead.
var Logger StdLogger = &defaultLogger{}
Loading