Skip to content

Commit

Permalink
Added DebugOutput flag to enable suppressing DebugMsg.
Browse files Browse the repository at this point in the history
  • Loading branch information
shomilj committed Oct 24, 2021
1 parent cd22116 commit eb6185b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions userlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,15 @@ var SymbolicVerbose = true
// the entire identifier in the symbolic representation.
var SymbolicMaxLength = 5

// If DebugOutput is set to false, then DebugMsg will suppress output.
var DebugOutput = true

// Feel free to use userlib.DebugMsg(...) to print strings to the console.
func DebugMsg(format string, args ...interface{}) {
msg := fmt.Sprintf("%v ", time.Now().Format("15:04:05.00000"))
log.Printf(msg+strings.Trim(format, "\r\n ")+"\n", args...)
if DebugOutput {
msg := fmt.Sprintf("%v ", time.Now().Format("15:04:05.00000"))
log.Printf(msg+strings.Trim(format, "\r\n ")+"\n", args...)
}
}

// The Symbolic Debugger lets you export a snapshot of the Datastore in a symbolic representation.
Expand Down

0 comments on commit eb6185b

Please sign in to comment.