Browse Source

wal: remove logging messages

These are noisy and unhelpful by default. We can re-add if at some point
we reintroduce debugging/multiple log levels.
Jonathan Boulle 11 years ago
parent
commit
cf4af47f7e
1 changed files with 0 additions and 8 deletions
  1. 0 8
      wal/wal.go

+ 0 - 8
wal/wal.go

@@ -21,7 +21,6 @@ import (
 	"fmt"
 	"fmt"
 	"hash/crc32"
 	"hash/crc32"
 	"io"
 	"io"
-	"log"
 	"os"
 	"os"
 	"path"
 	"path"
 	"sort"
 	"sort"
@@ -68,7 +67,6 @@ type WAL struct {
 
 
 // Create creates a WAL ready for appending records.
 // Create creates a WAL ready for appending records.
 func Create(dirpath string) (*WAL, error) {
 func Create(dirpath string) (*WAL, error) {
-	log.Printf("path=%s wal.create", dirpath)
 	if Exist(dirpath) {
 	if Exist(dirpath) {
 		return nil, os.ErrExist
 		return nil, os.ErrExist
 	}
 	}
@@ -101,7 +99,6 @@ func Create(dirpath string) (*WAL, error) {
 // index. The WAL cannot be appended to before reading out all of its
 // index. The WAL cannot be appended to before reading out all of its
 // previous records.
 // previous records.
 func OpenAtIndex(dirpath string, index int64) (*WAL, error) {
 func OpenAtIndex(dirpath string, index int64) (*WAL, error) {
-	log.Printf("path=%s wal.load index=%d", dirpath, index)
 	names, err := readDir(dirpath)
 	names, err := readDir(dirpath)
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err
@@ -222,8 +219,6 @@ func (w *WAL) Cut() error {
 	w.Sync()
 	w.Sync()
 	w.f.Close()
 	w.f.Close()
 
 
-	log.Printf("wal.cut index=%d prevfile=%s curfile=%s", w.enti, w.f.Name(), f.Name())
-
 	// update writer and save the previous crc
 	// update writer and save the previous crc
 	w.f = f
 	w.f = f
 	w.seq++
 	w.seq++
@@ -242,7 +237,6 @@ func (w *WAL) Sync() error {
 }
 }
 
 
 func (w *WAL) Close() {
 func (w *WAL) Close() {
-	log.Printf("path=%s wal.close", w.f.Name())
 	if w.f != nil {
 	if w.f != nil {
 		w.Sync()
 		w.Sync()
 		w.f.Close()
 		w.f.Close()
@@ -250,7 +244,6 @@ func (w *WAL) Close() {
 }
 }
 
 
 func (w *WAL) SaveInfo(i *raftpb.Info) error {
 func (w *WAL) SaveInfo(i *raftpb.Info) error {
-	log.Printf("path=%s wal.saveInfo id=%d", w.f.Name(), i.Id)
 	b, err := i.Marshal()
 	b, err := i.Marshal()
 	if err != nil {
 	if err != nil {
 		panic(err)
 		panic(err)
@@ -276,7 +269,6 @@ func (w *WAL) SaveState(s *raftpb.HardState) error {
 	if raft.IsEmptyHardState(*s) {
 	if raft.IsEmptyHardState(*s) {
 		return nil
 		return nil
 	}
 	}
-	log.Printf("path=%s wal.saveState state=\"%+v\"", w.f.Name(), s)
 	b, err := s.Marshal()
 	b, err := s.Marshal()
 	if err != nil {
 	if err != nil {
 		panic(err)
 		panic(err)