|
|
@@ -17,7 +17,6 @@ package wal
|
|
|
import (
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
- "log"
|
|
|
"strings"
|
|
|
|
|
|
"github.com/coreos/etcd/pkg/fileutil"
|
|
|
@@ -43,7 +42,7 @@ func searchIndex(names []string, index uint64) (int, bool) {
|
|
|
name := names[i]
|
|
|
_, curIndex, err := parseWalName(name)
|
|
|
if err != nil {
|
|
|
- log.Panicf("parse correct name should never fail: %v", err)
|
|
|
+ logger.Panicf("parse correct name should never fail: %v", err)
|
|
|
}
|
|
|
if index >= curIndex {
|
|
|
return i, true
|
|
|
@@ -59,7 +58,7 @@ func isValidSeq(names []string) bool {
|
|
|
for _, name := range names {
|
|
|
curSeq, _, err := parseWalName(name)
|
|
|
if err != nil {
|
|
|
- log.Panicf("parse correct name should never fail: %v", err)
|
|
|
+ logger.Panicf("parse correct name should never fail: %v", err)
|
|
|
}
|
|
|
if lastSeq != 0 && lastSeq != curSeq-1 {
|
|
|
return false
|
|
|
@@ -73,7 +72,7 @@ func checkWalNames(names []string) []string {
|
|
|
wnames := make([]string, 0)
|
|
|
for _, name := range names {
|
|
|
if _, _, err := parseWalName(name); err != nil {
|
|
|
- log.Printf("wal: ignored file %v in wal", name)
|
|
|
+ logger.Warningf("ignored file %v in wal", name)
|
|
|
continue
|
|
|
}
|
|
|
wnames = append(wnames, name)
|