aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-openapi/spec/debug.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-openapi/spec/debug.go')
-rw-r--r--vendor/github.com/go-openapi/spec/debug.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/vendor/github.com/go-openapi/spec/debug.go b/vendor/github.com/go-openapi/spec/debug.go
index 389c528ff6..fc889f6d0b 100644
--- a/vendor/github.com/go-openapi/spec/debug.go
+++ b/vendor/github.com/go-openapi/spec/debug.go
@@ -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...))
}
}