Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'internal/helper/debug.go')
-rw-r--r--internal/helper/debug.go15
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...)
+}