1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
package cryptfs import ( "fmt" ) type logChannel struct { enabled bool } func (l logChannel) Printf(format string, args ...interface{}) { if l.enabled == true { fmt.Printf(format, args...) } } var Debug = logChannel{false} var Warn = logChannel{true}