Create logger package and rename errorIf to LogIf (#5678)

Removing message from error logging
Replace errors.Trace with LogIf
This commit is contained in:
kannappanr
2018-04-05 15:04:40 -07:00
committed by GitHub
parent 91fd8ffeb7
commit f8a3fd0c2a
119 changed files with 2608 additions and 1860 deletions

View File

@@ -19,10 +19,13 @@
package cmd
import (
"context"
"io"
"os"
"path"
"strings"
"github.com/minio/minio/cmd/logger"
)
// Return all the entries at the directory dirPath.
@@ -57,7 +60,9 @@ func readDir(dirPath string) (entries []string, err error) {
var st os.FileInfo
st, err = os.Stat((path.Join(dirPath, fi.Name())))
if err != nil {
errorIf(err, "Unable to stat path %s", path.Join(dirPath, fi.Name()))
reqInfo := (&logger.ReqInfo{}).AppendTags("path", path.Join(dirPath, fi.Name()))
ctx := logger.SetReqInfo(context.Background(), reqInfo)
logger.LogIf(ctx, err)
continue
}
// Append to entries if symbolic link exists and is valid.