This commit is contained in:
techknowlogick 2021-02-28 18:08:33 -05:00 committed by GitHub
parent 030646eea4
commit 47f6a4ec3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
947 changed files with 26119 additions and 7062 deletions

View file

@ -18,14 +18,16 @@ import (
"fmt"
"log"
"os"
"path/filepath"
"path"
"runtime"
)
// Debug is true when the SWAGGER_DEBUG env var is not empty.
//
// It enables a more verbose logging of this package.
var Debug = os.Getenv("SWAGGER_DEBUG") != ""
var (
// Debug is true when the SWAGGER_DEBUG env var is not empty.
// It enables a more verbose logging of this package.
Debug = os.Getenv("SWAGGER_DEBUG") != ""
// specLogger is a debug logger for this package
specLogger *log.Logger
)
@ -42,6 +44,6 @@ func debugLog(msg string, args ...interface{}) {
// A private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog()
if Debug {
_, file1, pos1, _ := runtime.Caller(1)
specLogger.Printf("%s:%d: %s", filepath.Base(file1), pos1, fmt.Sprintf(msg, args...))
specLogger.Printf("%s:%d: %s", path.Base(file1), pos1, fmt.Sprintf(msg, args...))
}
}