mirror of
https://github.com/minio/minio.git
synced 2025-04-22 03:24:38 -04:00
parent
1946922de3
commit
0a6f9bc1eb
@ -23,7 +23,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/build"
|
"go/build"
|
||||||
"hash"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
@ -39,8 +38,6 @@ import (
|
|||||||
var (
|
var (
|
||||||
// HighwayHash key for logging in anonymous mode
|
// HighwayHash key for logging in anonymous mode
|
||||||
magicHighwayHash256Key = []byte("\x4b\xe7\x34\xfa\x8e\x23\x8a\xcd\x26\x3e\x83\xe6\xbb\x96\x85\x52\x04\x0f\x93\x5d\xa3\x9f\x44\x14\x97\xe0\x9d\x13\x22\xde\x36\xa0")
|
magicHighwayHash256Key = []byte("\x4b\xe7\x34\xfa\x8e\x23\x8a\xcd\x26\x3e\x83\xe6\xbb\x96\x85\x52\x04\x0f\x93\x5d\xa3\x9f\x44\x14\x97\xe0\x9d\x13\x22\xde\x36\xa0")
|
||||||
// HighwayHash hasher for logging in anonymous mode
|
|
||||||
loggerHighwayHasher hash.Hash
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Disable disables all logging, false by default. (used for "go test")
|
// Disable disables all logging, false by default. (used for "go test")
|
||||||
@ -207,8 +204,6 @@ func Init(goPath string, goRoot string) {
|
|||||||
// paths like "{GOROOT}/src/github.com/minio/minio"
|
// paths like "{GOROOT}/src/github.com/minio/minio"
|
||||||
// and "{GOPATH}/src/github.com/minio/minio"
|
// and "{GOPATH}/src/github.com/minio/minio"
|
||||||
trimStrings = append(trimStrings, filepath.Join("github.com", "minio", "minio")+string(filepath.Separator))
|
trimStrings = append(trimStrings, filepath.Join("github.com", "minio", "minio")+string(filepath.Separator))
|
||||||
|
|
||||||
loggerHighwayHasher, _ = highwayhash.New(magicHighwayHash256Key) // New will never return error since key is 256 bit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func trimTrace(f string) string {
|
func trimTrace(f string) string {
|
||||||
@ -263,10 +258,9 @@ func getTrace(traceLevel int) []string {
|
|||||||
|
|
||||||
// Return the highway hash of the passed string
|
// Return the highway hash of the passed string
|
||||||
func hashString(input string) string {
|
func hashString(input string) string {
|
||||||
defer loggerHighwayHasher.Reset()
|
hh, _ := highwayhash.New(magicHighwayHash256Key)
|
||||||
loggerHighwayHasher.Write([]byte(input))
|
hh.Write([]byte(input))
|
||||||
checksum := loggerHighwayHasher.Sum(nil)
|
return hex.EncodeToString(hh.Sum(nil))
|
||||||
return hex.EncodeToString(checksum)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Kind specifies the kind of error log
|
// Kind specifies the kind of error log
|
||||||
|
Loading…
x
Reference in New Issue
Block a user