Skip to content
This repository was archived by the owner on May 11, 2020. It is now read-only.

Commit d34c073

Browse files
vibhavpsbinet
authored andcommitted
disasm: Replace PrintDegbugInfo with function SetDebugMode.
SetDebugMode allows logging functionality to be enabled or disabled at will.
1 parent 62ab97a commit d34c073

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

disasm/log.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@ import (
1010
"os"
1111
)
1212

13-
var PrintDebugInfo = false
14-
1513
var logger *log.Logger
1614

17-
func init() {
15+
func SetDebugMode(l bool) {
1816
w := ioutil.Discard
1917

20-
if PrintDebugInfo {
18+
if l {
2119
w = os.Stderr
2220
}
2321

2422
logger = log.New(w, "", log.Lshortfile)
2523
logger.SetFlags(log.Lshortfile)
24+
25+
}
26+
27+
func init() {
28+
SetDebugMode(false)
2629
}

0 commit comments

Comments
 (0)