Selaa lähdekoodia

rename debug -> gocqlDebug

Chris Bannister 9 vuotta sitten
vanhempi
commit
cda7096df5
5 muutettua tiedostoa jossa 6 lisäystä ja 6 poistoa
  1. 1 1
      connectionpool.go
  2. 1 1
      control.go
  3. 1 1
      debug_off.go
  4. 1 1
      debug_on.go
  5. 2 2
      events.go

+ 1 - 1
connectionpool.go

@@ -459,7 +459,7 @@ func (pool *hostConnPool) logConnectErr(err error) {
 	if opErr, ok := err.(*net.OpError); ok && (opErr.Op == "dial" || opErr.Op == "read") {
 		// connection refused
 		// these are typical during a node outage so avoid log spam.
-		if debug {
+		if gocqlDebug {
 			log.Printf("unable to dial %q: %v\n", pool.host.Peer(), err)
 		}
 	} else if err != nil {

+ 1 - 1
control.go

@@ -299,7 +299,7 @@ func (c *controlConn) query(statement string, values ...interface{}) (iter *Iter
 			return conn.executeQuery(q)
 		})
 
-		if debug && iter.err != nil {
+		if gocqlDebug && iter.err != nil {
 			log.Printf("control: error executing %q: %v\n", statement, iter.err)
 		}
 

+ 1 - 1
debug_off.go

@@ -2,4 +2,4 @@
 
 package gocql
 
-const debug = false
+const gocqlDebug = false

+ 1 - 1
debug_on.go

@@ -2,4 +2,4 @@
 
 package gocql
 
-const debug = true
+const gocqlDebug = true

+ 2 - 2
events.go

@@ -91,7 +91,7 @@ func (s *Session) handleEvent(framer *framer) {
 		return
 	}
 
-	if debug {
+	if gocqlDebug {
 		log.Printf("gocql: handling frame: %v\n", frame)
 	}
 
@@ -140,7 +140,7 @@ func (s *Session) handleNodeEvent(frames []frame) {
 	}
 
 	for _, f := range events {
-		if debug {
+		if gocqlDebug {
 			log.Printf("gocql: dispatching event: %+v\n", f)
 		}