1
2
3
4
5
6
7 package inlheur
8
9 import (
10 "os"
11 "strconv"
12 )
13
14 var debugTrace = 0
15
16 func enableDebugTrace(x int) {
17 debugTrace = x
18 }
19
20 func enableDebugTraceIfEnv() {
21 v := os.Getenv("DEBUG_TRACE_INLHEUR")
22 if v == "" {
23 return
24 }
25 if v[0] == '*' {
26 if !UnitTesting() {
27 return
28 }
29 v = v[1:]
30 }
31 i, err := strconv.Atoi(v)
32 if err != nil {
33 return
34 }
35 debugTrace = i
36 }
37
38 func disableDebugTrace() {
39 debugTrace = 0
40 }
41
View as plain text