This commit is contained in:
Jesse Newland committed 2019-02-09 20:39:09 -06:00
1 parent de62a2eece
commit 3198627879
19 files changed
+1077 -19

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
// Copyright 2013 Andreas Koch. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package fswatch
import (
"fmt"
)
var (
debugIsEnabled = false
debugMessages chan string
)
func EnableDebug() chan string {
debugIsEnabled = true
debugMessages = make(chan string, 10)
return debugMessages
}
func DisableDebug() {
debugIsEnabled = false
close(debugMessages)
}
func log(format string, v ...interface{}) {
if !debugIsEnabled {
return
}
debugMessages <- fmt.Sprint(fmt.Sprintf(format, v...))
}