mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
Logging: errorIf fatalIf print in the format [file.go:82:funcName()] (#3127)
This commit is contained in:
committed by
Harshavardhana
parent
79b98b5c25
commit
0b3282ac9f
@@ -20,7 +20,6 @@ import (
|
||||
"errors"
|
||||
"net/url"
|
||||
pathutil "path"
|
||||
"runtime"
|
||||
"sync"
|
||||
|
||||
"github.com/minio/dsync"
|
||||
@@ -197,19 +196,7 @@ func (n *nsLockMap) unlock(volume, path, opsID string, readLock bool) {
|
||||
func (n *nsLockMap) Lock(volume, path, opsID string) {
|
||||
readLock := false // This is a write lock.
|
||||
|
||||
// The caller information of the lock held has been obtained
|
||||
// here before calling any other function.
|
||||
|
||||
// Fetching the package, function name and the line number of
|
||||
// the caller from the runtime.
|
||||
pc, file, line, success := runtime.Caller(1)
|
||||
if !success {
|
||||
file = "???"
|
||||
line = 0
|
||||
}
|
||||
shortFile := true // We are only interested in short file form.
|
||||
lockLocation := funcFromPC(pc, file, line, shortFile)
|
||||
|
||||
lockLocation := callerLocation() // Useful for debugging
|
||||
n.lock(volume, path, lockLocation, opsID, readLock)
|
||||
}
|
||||
|
||||
@@ -223,19 +210,7 @@ func (n *nsLockMap) Unlock(volume, path, opsID string) {
|
||||
func (n *nsLockMap) RLock(volume, path, opsID string) {
|
||||
readLock := true
|
||||
|
||||
// The caller information of the lock held has been obtained
|
||||
// here before calling any other function.
|
||||
|
||||
// Fetching the package, function name and the line number of
|
||||
// the caller from the runtime.
|
||||
pc, file, line, success := runtime.Caller(1)
|
||||
if !success {
|
||||
file = "???"
|
||||
line = 0
|
||||
}
|
||||
shortFile := true // We are only interested in short file form.
|
||||
lockLocation := funcFromPC(pc, file, line, shortFile)
|
||||
|
||||
lockLocation := callerLocation() // Useful for debugging
|
||||
n.lock(volume, path, lockLocation, opsID, readLock)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user