diff options
Diffstat (limited to 'internal/helper/debug.go')
-rw-r--r-- | internal/helper/debug.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/helper/debug.go b/internal/helper/debug.go new file mode 100644 index 000000000..f016ece8c --- /dev/null +++ b/internal/helper/debug.go @@ -0,0 +1,15 @@ +package helper + +import ( + "log" + "os" +) + +// Debugf behaves similarly to log.Printf. No-op unless GITALY_DEBUG=1. +func Debugf(format string, args ...interface{}) { + if os.Getenv("GITALY_DEBUG") != "1" { + return + } + + log.Printf("debug: "+format, args...) +} |